mirror of
https://github.com/immich-app/immich.git
synced 2025-05-21 21:01:13 +02:00
fix: update assets when duplicateId
is provided as null
(#18071)
Update assets when duplicateId is provided as null
This commit is contained in:
parent
1138f6dcce
commit
118a3fc9db
2 changed files with 19 additions and 4 deletions
server/src/services
|
@ -431,6 +431,21 @@ describe(AssetService.name, () => {
|
|||
{ name: JobName.SIDECAR_WRITE, data: { id: 'asset-1', dateTimeOriginal, latitude: 30, longitude: 50 } },
|
||||
]);
|
||||
});
|
||||
|
||||
it('should update Assets table if duplicateId is provided as null', async () => {
|
||||
mocks.access.asset.checkOwnerAccess.mockResolvedValue(new Set(['asset-1']));
|
||||
|
||||
await sut.updateAll(authStub.admin, {
|
||||
ids: ['asset-1'],
|
||||
latitude: 0,
|
||||
longitude: 0,
|
||||
isArchived: undefined,
|
||||
isFavorite: undefined,
|
||||
duplicateId: null,
|
||||
rating: undefined,
|
||||
});
|
||||
expect(mocks.asset.updateAll).toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
||||
describe('deleteAll', () => {
|
||||
|
|
|
@ -115,10 +115,10 @@ export class AssetService extends BaseService {
|
|||
}
|
||||
|
||||
if (
|
||||
options.isArchived != undefined ||
|
||||
options.isFavorite != undefined ||
|
||||
options.duplicateId != undefined ||
|
||||
options.rating != undefined
|
||||
options.isArchived !== undefined ||
|
||||
options.isFavorite !== undefined ||
|
||||
options.duplicateId !== undefined ||
|
||||
options.rating !== undefined
|
||||
) {
|
||||
await this.assetRepository.updateAll(ids, options);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue