fix(share): correct shared link URL to include /api prefix

The shared link URL was generated as {base_url}/s/{token} but the
API endpoint is actually at /api/s/{token}. This caused 404 errors
when users accessed shared links.

Fixes #101
This commit is contained in:
BillionClaw
2026-03-17 16:48:11 +08:00
parent d1699357d8
commit 852db02cd0
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -45,7 +45,7 @@ pub struct UpdateShareDto {
/// Extension methods to convert between DTOs and domain entities
impl ShareDto {
pub fn from_entity(share: &Share, base_url: &str) -> Self {
let url = format!("{}/s/{}", base_url, share.token());
let url = format!("{}/api/s/{}", base_url, share.token());
Self {
id: share.id().to_string(),
+1 -1
View File
@@ -1135,6 +1135,6 @@ mod tests {
assert_eq!(share_dto.item_id, "test_file_id");
assert_eq!(share_dto.item_type, "file");
assert!(share_dto.has_password);
assert!(share_dto.url.starts_with("http://127.0.0.1:8086/s/"));
assert!(share_dto.url.starts_with("http://127.0.0.1:8086/api/s/"));
}
}