chore: modify service and hanler

This commit is contained in:
riefive
2025-09-26 14:03:44 +07:00
parent 34a4fc11d0
commit 5d41e4e60d
9 changed files with 116 additions and 62 deletions
+4 -4
View File
@@ -4,7 +4,7 @@ import { ref } from 'vue'
import { type ToastFn, handleAsyncAction } from '~/handlers/_handler'
// Services
import { postSourceDevice, patchSourceDevice, removeSourceDevice } from '~/services/device.service'
import { postDevice, patchDevice, removeDevice } from '~/services/device.service'
const recId = ref<number>(0)
const recAction = ref<string>('')
@@ -28,7 +28,7 @@ export async function handleActionSave(
) {
isProcessing.value = true;
await handleAsyncAction<[any], any>({
action: postSourceDevice,
action: postDevice,
args: [values],
toast,
successMessage: 'Data berhasil disimpan',
@@ -53,7 +53,7 @@ export async function handleActionEdit(
) {
isProcessing.value = true;
await handleAsyncAction<[number | string, any], any>({
action: patchSourceDevice,
action: patchDevice,
args: [id, values],
toast,
successMessage: 'Data berhasil diubah',
@@ -76,7 +76,7 @@ export async function handleActionRemove(
) {
isProcessing.value = true;
await handleAsyncAction<[number | string], any>({
action: removeSourceDevice,
action: removeDevice,
args: [id],
toast,
successMessage: 'Data berhasil dihapus',