Fix id handling on update

This commit is contained in:
Joao Correia
2025-02-01 23:14:17 +00:00
parent ac539332e6
commit b684262759
5 changed files with 7 additions and 5 deletions

View File

@@ -35,7 +35,7 @@ export const createConfiguredWorkflows = async (workflows: ApprovalWorkflow[]) =
export const updateConfiguredWorkflow = async (workflow: ApprovalWorkflow) => {
const { _id, ...workflowWithoutId } = workflow as ApprovalWorkflow;
return await db.collection("configured-workflows").replaceOne({ _id: new ObjectId(_id) }, workflowWithoutId);
return await db.collection("configured-workflows").replaceOne({ _id: _id }, workflowWithoutId);
};
export const updateConfiguredWorkflows = async (workflows: ApprovalWorkflow[]) => {