chore: modify service and hanler
This commit is contained in:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user