From d052184c1230d360d7e1c8fa30d9fb07300ac7ec Mon Sep 17 00:00:00 2001 From: Kittapath Date: Thu, 4 May 2023 15:52:16 +0700 Subject: [PATCH] api review --- src/api/exam/api.candidate.ts | 2 + .../01_exam/components/ExamFinished.vue | 39 ++++++++++++------- 2 files changed, 26 insertions(+), 15 deletions(-) diff --git a/src/api/exam/api.candidate.ts b/src/api/exam/api.candidate.ts index d2262fe..0dff93b 100644 --- a/src/api/exam/api.candidate.ts +++ b/src/api/exam/api.candidate.ts @@ -34,6 +34,8 @@ export default { `${periodExam}position/${examId}/${positionId}`, periodExamPayment: (examId: string) => `${periodExam}payment/${examId}`, candidateCard: (examId: string, positionId: string) => `${candidate}card/${examId}/${positionId}`, + candidateReview: (examId: string, positionId: string) => + `${candidate}review/${examId}/${positionId}`, candidate, candidateBill: (examId: string, positionId: string) => `${candidate}bill/${examId}/${positionId}` } diff --git a/src/modules/01_exam/components/ExamFinished.vue b/src/modules/01_exam/components/ExamFinished.vue index 8f9700c..5ccec4b 100644 --- a/src/modules/01_exam/components/ExamFinished.vue +++ b/src/modules/01_exam/components/ExamFinished.vue @@ -42,6 +42,15 @@
แบบสอบถามความพึงพอใจ
+ +
@@ -142,6 +151,7 @@ const fetchStatus = async () => { scoreC.value = data.pointC examResultinscore.value = data.pass avatar.value = data.avatar + if (data.reviewPoint == null) dialog.value = true }) .catch(() => { // acceptTermOfUse.value = false @@ -152,21 +162,20 @@ const fetchStatus = async () => { } const sendRating = async () => { - // rating.value //คะแนน - // text.value //ข้อความ - // loader.value = true - // await http - // .get(config.API.candidateCard(examId.value, positionId.value)) - // .then((res) => { - - // }) - // .catch(() => { - // // acceptTermOfUse.value = false - // }) - // .finally(() => { - // loader.value = false - dialog.value = false - // }) + loader.value = true + await http + .put(config.API.candidateReview(examId.value, positionId.value), { + reviewPoint: rating.value, //คะแนน + review: text.value //ข้อความ + }) + .then((res) => {}) + .catch(() => { + // acceptTermOfUse.value = false + }) + .finally(() => { + loader.value = false + dialog.value = false + }) } const getClass = (val: string) => {