fix: resolve list organization source

This commit is contained in:
riefive
2025-10-04 08:30:16 +07:00
parent 6b69e48bd6
commit 41405ae113
11 changed files with 106 additions and 70 deletions

No files matched your search

+1 -14
View File
@@ -13,7 +13,6 @@ import { toast } from '~/components/pub/ui/toast'
// Types
import { ActionEvents, type HeaderPrep } from '~/components/pub/custom-ui/data/types'
import { SubspecialistSchema, type SubspecialistFormData } from '~/schemas/subspecialist.schema'
import type { Specialist } from '~/models/specialist'
// Handlers
import {
@@ -29,12 +28,11 @@ import {
handleActionRemove,
handleCancelForm,
} from '~/handlers/subspecialist.handler'
import { specialists, getSpecialistsList } from '~/handlers/_shared.handler'
// Services
import { getSubspecialists, getSubspecialistDetail } from '~/services/subspecialist.service'
import { getSpecialists } from '~/services/specialist.service'
const specialists = ref<{ value: string; label: string }[]>([])
const title = ref('')
const {
@@ -93,17 +91,6 @@ const getCurrentSubSpecialistDetail = async (id: number | string) => {
}
}
const getSpecialistsList = async () => {
const result = await getSpecialists()
if (result.success) {
const currentSpecialists = result.body?.data || []
specialists.value = currentSpecialists.map((item: Specialist) => ({
value: item.id ? Number(item.id) : item.code,
label: item.name,
}))
}
}
// Watch for row actions when recId or recAction changes
watch([recId, recAction], () => {
switch (recAction.value) {