mirror of
https://github.com/immich-app/immich.git
synced 2026-03-25 19:18:57 +03:00
fix: remove assets from shared link (#22935)
* fix remove assets from shared link * rename var * test: should remove individually shared asset * test: should share individually assets * fix failing tests
This commit is contained in:
@@ -175,10 +175,12 @@ export class SharedLinkService extends BaseService {
|
||||
throw new BadRequestException('Invalid shared link type');
|
||||
}
|
||||
|
||||
const removedAssetIds = await this.sharedLinkAssetRepository.remove(id, dto.assetIds);
|
||||
|
||||
const results: AssetIdsResponseDto[] = [];
|
||||
for (const assetId of dto.assetIds) {
|
||||
const hasAsset = sharedLink.assets.find((asset) => asset.id === assetId);
|
||||
if (!hasAsset) {
|
||||
const wasRemoved = removedAssetIds.find((id) => id === assetId);
|
||||
if (!wasRemoved) {
|
||||
results.push({ assetId, success: false, error: AssetIdErrorReason.NOT_FOUND });
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user