adjust form submit,list, and detail
refactor(patient-preview): comment out unused occupation field in patient preview fix(handler): return success response from update operation in crud handler fix search patient add handle del search char for ease use
This commit is contained in:
@@ -165,16 +165,20 @@ export function genCrudHandler<T = any>(crud: {
|
||||
refresh: () => void,
|
||||
reset: () => void,
|
||||
toast: ToastFn,
|
||||
) {
|
||||
): Promise<any | null> {
|
||||
isProcessing.value = true
|
||||
|
||||
let successResponse: any = null
|
||||
|
||||
await handleAsyncAction<[number | string, any], any>({
|
||||
action: crud.update,
|
||||
args: [id, values],
|
||||
toast,
|
||||
successMessage: 'Data berhasil diubah',
|
||||
errorMessage: 'Gagal mengubah data',
|
||||
onSuccess: () => {
|
||||
onSuccess: (result) => {
|
||||
isFormEntryDialogOpen.value = false
|
||||
successResponse = result
|
||||
if (refresh) refresh()
|
||||
},
|
||||
onFinally: (isSuccess: boolean) => {
|
||||
@@ -182,6 +186,8 @@ export function genCrudHandler<T = any>(crud: {
|
||||
isProcessing.value = false
|
||||
},
|
||||
})
|
||||
|
||||
return successResponse
|
||||
}
|
||||
|
||||
async function handleActionRemove(id: number | string, refresh: () => void, toast: ToastFn) {
|
||||
|
||||
Reference in New Issue
Block a user