progress
This commit is contained in:
@@ -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 { toast } from '~/components/pub/ui/toast'
|
||||||
import Confirmation from '~/components/pub/my-ui/confirmation/confirmation.vue'
|
import Confirmation from '~/components/pub/my-ui/confirmation/confirmation.vue'
|
||||||
import { KfrSchema, } from '~/schemas/kfr.schema'
|
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';
|
import { getDetail } from '~/services/kfr.service';
|
||||||
|
|
||||||
// #region Props & Emits
|
// #region Props & Emits
|
||||||
@@ -50,12 +50,20 @@ function goBack() {
|
|||||||
|
|
||||||
async function handleConfirmAdd() {
|
async function handleConfirmAdd() {
|
||||||
const inputData: any = await composeFormData()
|
const inputData: any = await composeFormData()
|
||||||
const response = await handleActionSave(
|
const response = props.mode === `add`
|
||||||
inputData,
|
? await handleActionSave(
|
||||||
() => { },
|
inputData,
|
||||||
() => { },
|
() => { },
|
||||||
toast,
|
() => { },
|
||||||
)
|
toast,
|
||||||
|
)
|
||||||
|
: await handleActionEdit(
|
||||||
|
kfrId,
|
||||||
|
inputData,
|
||||||
|
() => { },
|
||||||
|
() => { },
|
||||||
|
toast,
|
||||||
|
)
|
||||||
|
|
||||||
const data = (response?.body?.data ?? null)
|
const data = (response?.body?.data ?? null)
|
||||||
if (!data) return
|
if (!data) return
|
||||||
|
|||||||
Reference in New Issue
Block a user