refactor(api): clarify affected allocation resource ids
This commit is contained in:
@@ -268,12 +268,15 @@ export const allocationAssignmentProcedures = {
|
|||||||
return updatedAllocation;
|
return updatedAllocation;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const affectedResourceIds = [existing.entry.resourceId, updated.resourceId].filter(
|
||||||
|
(resourceId): resourceId is string => Boolean(resourceId),
|
||||||
|
);
|
||||||
|
|
||||||
publishAllocationUpdated(ctx.db, {
|
publishAllocationUpdated(ctx.db, {
|
||||||
id: updated.id,
|
id: updated.id,
|
||||||
projectId: updated.projectId,
|
projectId: updated.projectId,
|
||||||
resourceId: updated.resourceId,
|
resourceId: updated.resourceId,
|
||||||
resourceIds: [existing.entry.resourceId, updated.resourceId]
|
resourceIds: affectedResourceIds,
|
||||||
.filter((resourceId): resourceId is string => Boolean(resourceId)),
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return updated;
|
return updated;
|
||||||
|
|||||||
Reference in New Issue
Block a user