Merge pull request #223 from BillionClaw/clawoss/fix/shared-link-404
fix(share): correct shared link URL to include /api prefix
This commit is contained in:
@@ -45,7 +45,7 @@ pub struct UpdateShareDto {
|
|||||||
/// Extension methods to convert between DTOs and domain entities
|
/// Extension methods to convert between DTOs and domain entities
|
||||||
impl ShareDto {
|
impl ShareDto {
|
||||||
pub fn from_entity(share: &Share, base_url: &str) -> Self {
|
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 {
|
Self {
|
||||||
id: share.id().to_string(),
|
id: share.id().to_string(),
|
||||||
|
|||||||
@@ -1135,6 +1135,6 @@ mod tests {
|
|||||||
assert_eq!(share_dto.item_id, "test_file_id");
|
assert_eq!(share_dto.item_id, "test_file_id");
|
||||||
assert_eq!(share_dto.item_type, "file");
|
assert_eq!(share_dto.item_type, "file");
|
||||||
assert!(share_dto.has_password);
|
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/"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user