From 4a465f399269037f9b0e19e06a2d9b2eae0f924e Mon Sep 17 00:00:00 2001 From: hasyim_kai Date: Mon, 24 Nov 2025 13:40:22 +0700 Subject: [PATCH] progress --- app/components/content/kfr/entry.vue | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/app/components/content/kfr/entry.vue b/app/components/content/kfr/entry.vue index 743351bc..a2352c1a 100644 --- a/app/components/content/kfr/entry.vue +++ b/app/components/content/kfr/entry.vue @@ -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