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;