switch to mongo's id handling
This commit is contained in:
@@ -108,7 +108,7 @@ export default function Home({ user, workflow, userEntitiesWithLabel, userEntiti
|
||||
}));
|
||||
|
||||
const editableWorkflow: EditableApprovalWorkflow = {
|
||||
id: uuidv4(),
|
||||
id: uuidv4(), // this id is only used in UI. it is ommited on submission to DB and lets mongo handle unique id.
|
||||
name: workflow.name,
|
||||
entityId: workflow.entityId,
|
||||
requester: user.id,
|
||||
@@ -141,7 +141,7 @@ export default function Home({ user, workflow, userEntitiesWithLabel, userEntiti
|
||||
};
|
||||
|
||||
axios
|
||||
.post(`/api/approval-workflows/${workflow.id}/clone`, filteredWorkflow)
|
||||
.post(`/api/approval-workflows/${workflow._id}/clone`, filteredWorkflow)
|
||||
.then(() => {
|
||||
toast.success("Approval Workflow cloned successfully.");
|
||||
setIsRedirecting(true);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user