Skip to content

Commit

Permalink
chore(collections): Remove from all collections improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
jorenn92 committed Dec 11, 2023
1 parent 9a81f31 commit b871036
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions server/src/modules/collections/collections.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ export class CollectionsService {
const handleMedia: AddCollectionMedia[] = [];

const collection =
collectionDbId !== -1
collectionDbId !== -1 && collectionDbId !== undefined
? await this.collectionRepo.findOne({
where: { id: collectionDbId },
})
Expand Down Expand Up @@ -520,7 +520,11 @@ export class CollectionsService {
if (action === 'add') {
return this.addToCollection(collectionDbId, handleMedia, true);
} else if (action === 'remove') {
return this.removeFromCollection(collectionDbId, handleMedia);
if (collectionDbId) {
return this.removeFromCollection(collectionDbId, handleMedia);
} else {
this.removeFromAllCollections(handleMedia);
}
}
}

Expand Down

0 comments on commit b871036

Please sign in to comment.