diff --git a/apps/frontend/src/modules/aspectManagement/modals/AspectFormModal.tsx b/apps/frontend/src/modules/aspectManagement/modals/AspectFormModal.tsx index e7ab84c..dd3496b 100644 --- a/apps/frontend/src/modules/aspectManagement/modals/AspectFormModal.tsx +++ b/apps/frontend/src/modules/aspectManagement/modals/AspectFormModal.tsx @@ -29,9 +29,9 @@ export default function AspectFormModal() { const searchParams = routeApi.useSearch(); const dataId = searchParams.detail || searchParams.edit; const isDialogOpen = Boolean(dataId || searchParams.create); - const formType = searchParams.detail ? "detail" : searchParams.edit ? "edit" : "tambah"; + const formType = searchParams.detail ? "detail" : searchParams.edit ? "ubah" : "tambah"; - // Fetch aspect data if editing or viewing details + // Fetch aspect data if ubahing or viewing details const aspectQuery = useQuery(getAspectByIdQueryOptions(dataId)); const modalTitle = `${formType.charAt(0).toUpperCase() + formType.slice(1)} Aspek`; @@ -69,10 +69,10 @@ export default function AspectFormModal() { mutationKey: ["aspectMutation"], mutationFn: async ( options: - | { action: "edit"; data: Parameters[0] } - | { action: "create"; data: Parameters[0] } + | { action: "ubah"; data: Parameters[0] } + | { action: "tambah"; data: Parameters[0] } ) => { - return options.action === "edit" + return options.action === "ubah" ? await updateAspect(options.data) : await createAspect(options.data); }, @@ -134,7 +134,7 @@ export default function AspectFormModal() { : "", }; await createAspect(payload); - } else if (formType === "edit") { + } else if (formType === "ubah") { payload = { id: values.id, name: values.name, @@ -156,7 +156,7 @@ export default function AspectFormModal() { queryClient.invalidateQueries({ queryKey: ["management-aspect"] }); notifications.show({ - message: `Aspek ${formType === "tambah" ? "berhasil dibuat" : "berhasil diedit"}`, + message: `Aspek ${formType === "tambah" ? "berhasil dibuat" : "berhasil diubah"}`, }); navigate({ search: {} });