fix: update assets when duplicateId is provided as null ()

Update assets when duplicateId is provided as null
This commit is contained in:
Jovan Gerodetti 2025-05-06 14:47:19 +02:00 committed by GitHub
parent 1138f6dcce
commit 118a3fc9db
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 19 additions and 4 deletions

View file

@ -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', () => {

View file

@ -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);
}