diff --git a/apps/frontend/src/modules/questionsManagement/modals/QuestionFormModal.tsx b/apps/frontend/src/modules/questionsManagement/modals/QuestionFormModal.tsx index 764e932..b75c958 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" : "create"; + const formType = detailId ? "detail" : editId ? "edit" : "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" | "create"; + action: "edit" | "tambah"; data: CreateQuestionPayload | UpdateQuestionPayload; } @@ -161,8 +161,8 @@ export default function QuestionFormModal() { }; try { - if (formType === "create") { - await mutation.mutateAsync({ action: "create", data: payload }); + if (formType === "tambah") { + await mutation.mutateAsync({ action: "tambah", data: payload }); notifications.show({ message: "Data pertanyaan berhasil dibuat!", color: "green",