Keep exam confidential even after approval workflow is completed
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user