diff --git a/src/lib/createWorkflowsOnExamCreation.ts b/src/lib/createWorkflowsOnExamCreation.ts index e2a791af..0f8e1c53 100644 --- a/src/lib/createWorkflowsOnExamCreation.ts +++ b/src/lib/createWorkflowsOnExamCreation.ts @@ -72,7 +72,7 @@ export async function createApprovalWorkflowOnExamCreation(examAuthor: string, e if (totalCount === 0) { // current behaviour: if no workflow was found skip approval process await db.collection(examModule).updateOne( { id: examId }, - { $set: { id: examId, isDiagnostic: false }}, + { $set: { id: examId, access: "private" }}, { upsert: true } ); } diff --git a/src/pages/approval-workflows/[id]/edit.tsx b/src/pages/approval-workflows/[id]/edit.tsx index aec4fd1f..0c549e13 100644 --- a/src/pages/approval-workflows/[id]/edit.tsx +++ b/src/pages/approval-workflows/[id]/edit.tsx @@ -73,13 +73,9 @@ export default function Home({ user, workflow, workflowEntityApprovers }: Props) })); const editableWorkflow: EditableApprovalWorkflow = { + ...workflow, id: workflow._id?.toString() ?? "", - name: workflow.name, - entityId: workflow.entityId, requester: user.id, // should it change to the editor? - startDate: workflow.startDate, - modules: workflow.modules, - status: workflow.status, steps: editableSteps, }; diff --git a/src/pages/approval-workflows/[id]/index.tsx b/src/pages/approval-workflows/[id]/index.tsx index 2b512ba0..4048df94 100644 --- a/src/pages/approval-workflows/[id]/index.tsx +++ b/src/pages/approval-workflows/[id]/index.tsx @@ -260,10 +260,7 @@ export default function Home({ user, initialWorkflow, id, workflowAssignees, wor if (examModule && examId) { const exam = await getExamById(examModule, examId.trim()); if (!exam) { - toast.error( - "Unknown Exam ID! Please make sure you selected the right module and entered the right exam ID", - { toastId: "invalid-exam-id" } - ); + toast.error("Something went wrong while fetching exam!"); setViewExamIsLoading(false); return; }