Keep exam confidential even after approval workflow is completed

This commit is contained in:
Joao Correia
2025-02-26 16:51:57 +00:00
parent 93d9e49358
commit a4ef2222e2
2 changed files with 6 additions and 6 deletions

View File

@@ -68,14 +68,14 @@ export async function createApprovalWorkflowOnExamCreation(examAuthor: string, e
}
}
// prettier-ignore
if (totalCount === 0) { // current behaviour: if no workflow was found skip approval process
// commented because they asked for every exam to stay confidential
/* if (totalCount === 0) { // current behaviour: if no workflow was found skip approval process
await db.collection(examModule).updateOne(
{ id: examId },
{ $set: { id: examId, access: "private" }},
{ upsert: true }
);
}
} */
return {
successCount,

View File

@@ -150,7 +150,7 @@ export default function Home({ user, initialWorkflow, id, workflowAssignees, wor
const handleApproveStep = () => {
const isLastStep = (selectedStepIndex + 1 === currentWorkflow.steps.length);
if (isLastStep) {
if (!confirm(`Are you sure you want to approve the last step? Doing so will change the access type of the exam from confidential to private.`)) return;
if (!confirm(`Are you sure you want to approve the last step and complete the approval process?`)) return;
}
const updatedWorkflow: ApprovalWorkflow = {
@@ -188,7 +188,7 @@ export default function Home({ user, initialWorkflow, id, workflowAssignees, wor
if (isLastStep) {
setIsPanelOpen(false);
const examModule = currentWorkflow.modules[0];
/* const examModule = currentWorkflow.modules[0];
const examId = currentWorkflow.examId;
axios
@@ -207,7 +207,7 @@ export default function Home({ user, initialWorkflow, id, workflowAssignees, wor
toast.error("Something went wrong, please try again later.");
})
.finally(reload);
.finally(reload); */
} else {
handleStepClick(selectedStepIndex + 1, currentWorkflow.steps[selectedStepIndex + 1]);
}