switch to mongo's id handling

This commit is contained in:
Joao Correia
2025-01-30 11:50:28 +00:00
parent 5d727fc528
commit c968044160
6 changed files with 29 additions and 32 deletions

View File

@@ -71,7 +71,7 @@ export default function Home({ user, workflow, workflowEntityTeachers, workflowE
}));
const editableWorkflow: EditableApprovalWorkflow = {
id: workflow.id,
id: workflow._id?.toString() ?? "",
name: workflow.name,
entityId: workflow.entityId,
requester: user.id, // should it change to the editor?
@@ -104,7 +104,7 @@ export default function Home({ user, workflow, workflowEntityTeachers, workflowE
};
axios
.put(`/api/approval-workflows/${workflow.id}/edit`, filteredWorkflow)
.put(`/api/approval-workflows/${updatedWorkflow.id}/edit`, filteredWorkflow)
.then(() => {
toast.success("Approval Workflow edited successfully.");
setIsRedirecting(true);