From 7d8fa7bfc0ef7a01d504e9a86ece8c512ee504dd Mon Sep 17 00:00:00 2001 From: falendikategar Date: Thu, 21 Nov 2024 13:35:25 +0700 Subject: [PATCH] update: language adjustment on edit modal in question management --- .../questionsManagement/modals/QuestionFormModal.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/frontend/src/modules/questionsManagement/modals/QuestionFormModal.tsx b/apps/frontend/src/modules/questionsManagement/modals/QuestionFormModal.tsx index b75c958..ab79046 100644 --- a/apps/frontend/src/modules/questionsManagement/modals/QuestionFormModal.tsx +++ b/apps/frontend/src/modules/questionsManagement/modals/QuestionFormModal.tsx @@ -57,7 +57,7 @@ export default function QuestionFormModal() { const isModalOpen = Boolean(dataId || searchParams.create); const detailId = searchParams.detail; const editId = searchParams.edit; - const formType = detailId ? "detail" : editId ? "edit" : "tambah"; + const formType = detailId ? "detail" : editId ? "ubah" : "tambah"; const form = useForm({ initialValues: { @@ -126,7 +126,7 @@ export default function QuestionFormModal() { // Define possible actions, depending on the action, it can be one or the other interface MutationOptions { - action: "edit" | "tambah"; + action: "ubah" | "tambah"; data: CreateQuestionPayload | UpdateQuestionPayload; } @@ -137,7 +137,7 @@ export default function QuestionFormModal() { const mutation = useMutation({ mutationKey: ["questionsMutation"], mutationFn: async (options) => { - if (options.action === "edit") { + if (options.action === "ubah") { return await updateQuestion(options.data as UpdateQuestionPayload); } else { return await createQuestion(options.data as CreateQuestionPayload); @@ -168,7 +168,7 @@ export default function QuestionFormModal() { color: "green", }); } else { - await mutation.mutateAsync({ action: "edit", data: payload }); + await mutation.mutateAsync({ action: "ubah", data: payload }); notifications.show({ message: "Data pertanyaan berhasil diperbarui!", color: "green",