This commit is contained in:
hasyim_kai
2025-11-24 13:40:22 +07:00
parent 7811f051a5
commit 4a465f3992
+15 -7
View File
@@ -5,7 +5,7 @@ import Action from '~/components/pub/my-ui/nav-footer/ba-dr-su.vue'
import { toast } from '~/components/pub/ui/toast'
import Confirmation from '~/components/pub/my-ui/confirmation/confirmation.vue'
import { KfrSchema, } from '~/schemas/kfr.schema'
import { handleActionSave } from '~/handlers/kfr.handler'
import { handleActionSave, handleActionEdit } from '~/handlers/kfr.handler'
import { getDetail } from '~/services/kfr.service';
// #region Props & Emits
@@ -50,12 +50,20 @@ function goBack() {
async function handleConfirmAdd() {
const inputData: any = await composeFormData()
const response = await handleActionSave(
inputData,
() => { },
() => { },
toast,
)
const response = props.mode === `add`
? await handleActionSave(
inputData,
() => { },
() => { },
toast,
)
: await handleActionEdit(
kfrId,
inputData,
() => { },
() => { },
toast,
)
const data = (response?.body?.data ?? null)
if (!data) return