Fix DAV url for remote.php in subfolder

Fixes #289

Patch by @sweehua
pull/260/head
Varun Patil 2023-01-04 12:21:55 -08:00
parent d5a15eab3d
commit f7bf45dc86
1 changed files with 3 additions and 3 deletions

View File

@ -1,4 +1,4 @@
import { generateUrl } from "@nextcloud/router"; import { generateUrl, getRootUrl } from "@nextcloud/router";
import axios from "@nextcloud/axios"; import axios from "@nextcloud/axios";
import { showError } from "@nextcloud/dialogs"; import { showError } from "@nextcloud/dialogs";
import { translate as t } from "@nextcloud/l10n"; import { translate as t } from "@nextcloud/l10n";
@ -68,9 +68,9 @@ export function getDownloadLink(photo: IPhoto) {
<string>route.params.name <string>route.params.name
); );
if (fInfos.length) { if (fInfos.length) {
return generateUrl(`/remote.php/dav${fInfos[0].originalFilename}`); return getRootUrl() + `/remote.php/dav${fInfos[0].originalFilename}`;
} }
} }
return generateUrl(`/remote.php/dav${photo.filename}`); return getRootUrl() + `/remote.php/dav${photo.filename}`;
} }