You've already forked immich
mirror of
https://github.com/immich-app/immich.git
synced 2025-06-16 03:40:33 +02:00
refactor(server): shared links (#1385)
* refactor(server): shared links * chore: tests * fix: bugs and tests * fix: missed one expired at * fix: standardize file upload checks * test: lower flutter version Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
This commit is contained in:
@ -60,7 +60,7 @@
|
||||
if (shareType === SharedLinkType.Album && album) {
|
||||
const { data } = await api.albumApi.createAlbumSharedLink({
|
||||
albumId: album.id,
|
||||
expiredAt: expirationDate,
|
||||
expiresAt: expirationDate,
|
||||
allowUpload: isAllowUpload,
|
||||
description: description,
|
||||
allowDownload: isAllowDownload,
|
||||
@ -70,7 +70,7 @@
|
||||
} else {
|
||||
const { data } = await api.assetApi.createAssetsSharedLink({
|
||||
assetIds: sharedAssets.map((a) => a.id),
|
||||
expiredAt: expirationDate,
|
||||
expiresAt: expirationDate,
|
||||
allowUpload: isAllowUpload,
|
||||
description: description,
|
||||
allowDownload: isAllowDownload,
|
||||
@ -128,19 +128,14 @@
|
||||
try {
|
||||
const expirationTime = getExpirationTimeInMillisecond();
|
||||
const currentTime = new Date().getTime();
|
||||
let expirationDate = expirationTime
|
||||
const expirationDate: string | null = expirationTime
|
||||
? new Date(currentTime + expirationTime).toISOString()
|
||||
: undefined;
|
||||
|
||||
if (expirationTime === 0) {
|
||||
expirationDate = undefined;
|
||||
}
|
||||
: null;
|
||||
|
||||
await api.shareApi.editSharedLink(editingLink.id, {
|
||||
description: description,
|
||||
expiredAt: expirationDate,
|
||||
description,
|
||||
expiresAt: shouldChangeExpirationTime ? expirationDate : undefined,
|
||||
allowUpload: isAllowUpload,
|
||||
isEditExpireTime: shouldChangeExpirationTime,
|
||||
allowDownload: isAllowDownload,
|
||||
showExif: shouldShowExif
|
||||
});
|
||||
|
Reference in New Issue
Block a user