Merged in approval-workflows (pull request #157)
add approved field to exam Approved-by: Tiago Ribeiro
This commit is contained in:
@@ -29,6 +29,7 @@ export interface ExamBase {
|
|||||||
access: AccessType;
|
access: AccessType;
|
||||||
label?: string;
|
label?: string;
|
||||||
requiresApproval?: boolean;
|
requiresApproval?: boolean;
|
||||||
|
approved?: boolean;
|
||||||
}
|
}
|
||||||
export interface ReadingExam extends ExamBase {
|
export interface ReadingExam extends ExamBase {
|
||||||
module: "reading";
|
module: "reading";
|
||||||
|
|||||||
@@ -188,11 +188,11 @@ export default function Home({ user, initialWorkflow, id, workflowAssignees, wor
|
|||||||
|
|
||||||
if (isLastStep) {
|
if (isLastStep) {
|
||||||
setIsPanelOpen(false);
|
setIsPanelOpen(false);
|
||||||
/* const examModule = currentWorkflow.modules[0];
|
const examModule = currentWorkflow.modules[0];
|
||||||
const examId = currentWorkflow.examId;
|
const examId = currentWorkflow.examId;
|
||||||
|
|
||||||
axios
|
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.`))
|
.then(() => toast.success(`The exam was successfuly approved and this workflow has been completed.`))
|
||||||
.catch((reason) => {
|
.catch((reason) => {
|
||||||
if (reason.response.status === 404) {
|
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.");
|
toast.error("Something went wrong, please try again later.");
|
||||||
})
|
})
|
||||||
.finally(reload); */
|
.finally(reload);
|
||||||
} else {
|
} else {
|
||||||
handleStepClick(selectedStepIndex + 1, currentWorkflow.steps[selectedStepIndex + 1]);
|
handleStepClick(selectedStepIndex + 1, currentWorkflow.steps[selectedStepIndex + 1]);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user