fix(server): on_asset_update event sends varying data types (#7179)

This commit is contained in:
Michel Heusschen 2024-02-18 23:50:32 +01:00 committed by GitHub
parent 072f61927c
commit 4b46bb49d7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 37 additions and 6 deletions

View file

@ -381,7 +381,7 @@ export class AssetService {
.flatMap((stack) => (stack ? [stack] : []))
.filter((stack) => stack.assets.length < 2);
await Promise.all(stacksToDelete.map((as) => this.assetStackRepository.delete(as.id)));
this.communicationRepository.send(ClientEvent.ASSET_UPDATE, auth.user.id, ids);
this.communicationRepository.send(ClientEvent.ASSET_STACK_UPDATE, auth.user.id, ids);
}
async handleAssetDeletionCheck() {
@ -499,7 +499,11 @@ export class AssetService {
primaryAssetId: newParentId,
});
this.communicationRepository.send(ClientEvent.ASSET_UPDATE, auth.user.id, [...childIds, newParentId, oldParentId]);
this.communicationRepository.send(ClientEvent.ASSET_STACK_UPDATE, auth.user.id, [
...childIds,
newParentId,
oldParentId,
]);
await this.assetRepository.updateAll([oldParentId, newParentId, ...childIds], { updatedAt: new Date() });
}