From 852db02cd01d1465ffed96a80f37e4c17d1ecd8a Mon Sep 17 00:00:00 2001 From: BillionClaw <267901332+BillionClaw@users.noreply.github.com> Date: Tue, 17 Mar 2026 16:48:11 +0800 Subject: [PATCH] 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 --- src/application/dtos/share_dto.rs | 2 +- src/application/services/share_service.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/application/dtos/share_dto.rs b/src/application/dtos/share_dto.rs index 2e732f9e..cc454152 100755 --- a/src/application/dtos/share_dto.rs +++ b/src/application/dtos/share_dto.rs @@ -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(), diff --git a/src/application/services/share_service.rs b/src/application/services/share_service.rs index 14e25800..d9e26d13 100755 --- a/src/application/services/share_service.rs +++ b/src/application/services/share_service.rs @@ -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/")); } }