Merged in approval-workflows (pull request #154)

Approval Workflows

Approved-by: Tiago Ribeiro
This commit is contained in:
João Correia
2025-02-20 14:30:24 +00:00
committed by Tiago Ribeiro
3 changed files with 3 additions and 10 deletions

View File

@@ -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 }
);
}

View File

@@ -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,
};

View File

@@ -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;
}