From a9028290f2dcb95dd3574bf813d71f805682720b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hartmut=20N=C3=B6renberg?= Date: Tue, 31 Mar 2026 22:22:22 +0200 Subject: [PATCH] refactor(api): clarify affected allocation resource ids --- .../api/src/router/allocation-assignment-procedures.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/api/src/router/allocation-assignment-procedures.ts b/packages/api/src/router/allocation-assignment-procedures.ts index a19e592..932574f 100644 --- a/packages/api/src/router/allocation-assignment-procedures.ts +++ b/packages/api/src/router/allocation-assignment-procedures.ts @@ -268,12 +268,15 @@ export const allocationAssignmentProcedures = { return updatedAllocation; }); + const affectedResourceIds = [existing.entry.resourceId, updated.resourceId].filter( + (resourceId): resourceId is string => Boolean(resourceId), + ); + publishAllocationUpdated(ctx.db, { id: updated.id, projectId: updated.projectId, resourceId: updated.resourceId, - resourceIds: [existing.entry.resourceId, updated.resourceId] - .filter((resourceId): resourceId is string => Boolean(resourceId)), + resourceIds: affectedResourceIds, }); return updated;