Fix: Refactor Organization CRUD {id} to {code}

This commit is contained in:
hasyim_kai
2025-11-11 14:07:46 +07:00
parent 3f63f195d0
commit 270869b928
52 changed files with 211 additions and 216 deletions
@@ -108,7 +108,7 @@ watch([recId, recAction], () => {
isReadonly.value = true
break
case ActionEvents.showEdit:
getCurrentInstallationDetail(recId.value)
getCurrentInstallationDetail(recItem.value.code)
title.value = 'Edit Instalasi - Posisi'
isReadonly.value = false
break
@@ -120,7 +120,7 @@ watch([recId, recAction], () => {
onMounted(async () => {
try {
installations.value = await getInstallationLabelList({ sort: 'createdAt:asc', 'page-size': 100 })
installations.value = await getInstallationLabelList({ sort: 'createdAt:asc', 'page-size': 100 }, true)
employees.value = await getEmployeeLabelList({ sort: 'createdAt:asc', 'page-size': 100, includes: 'person' })
} catch (err) {
console.log(err)
@@ -169,8 +169,8 @@ onMounted(async () => {
:is-readonly="isReadonly"
@submit="
(values: InstallationPositionFormData | Record<string, any>, resetForm: () => void) => {
if (recId > 0) {
handleActionEdit(recId, values, getInstallationPositionList, resetForm, toast)
if (recItem?.code.length > 0) {
handleActionEdit(recItem.code, values, getInstallationPositionList, resetForm, toast)
return
}
handleActionSave(values, getInstallationPositionList, resetForm, toast)
@@ -185,7 +185,7 @@ onMounted(async () => {
v-model:open="isRecordConfirmationOpen"
action="delete"
:record="recItem"
@confirm="() => handleActionRemove(recId, getInstallationPositionList, toast)"
@confirm="() => handleActionRemove(recItem.code, getInstallationPositionList, toast)"
@cancel=""
>
<template #default="{ record }">