add approved field to exam
This commit is contained in:
@@ -29,6 +29,7 @@ export interface ExamBase {
|
||||
access: AccessType;
|
||||
label?: string;
|
||||
requiresApproval?: boolean;
|
||||
approved?: boolean;
|
||||
}
|
||||
export interface ReadingExam extends ExamBase {
|
||||
module: "reading";
|
||||
|
||||
@@ -188,11 +188,11 @@ 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
|
||||
.patch(`/api/exam/${examModule}/${examId}`, { access: "private" })
|
||||
.patch(`/api/exam/${examModule}/${examId}`, { approved: true })
|
||||
.then(() => toast.success(`The exam was successfuly approved and this workflow has been completed.`))
|
||||
.catch((reason) => {
|
||||
if (reason.response.status === 404) {
|
||||
@@ -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