Merge branch 'dev' into feat/consultation-82
This commit is contained in:
@@ -13,6 +13,7 @@ import { toast } from '~/components/pub/ui/toast'
|
||||
// Types
|
||||
import { ActionEvents, type HeaderPrep } from '~/components/pub/my-ui/data/types'
|
||||
import { DivisionSchema, type DivisionFormData } from '~/schemas/division.schema'
|
||||
import type { Division } from "~/models/division"
|
||||
import type { TreeItem } from '~/models/_base'
|
||||
|
||||
// Handlers
|
||||
@@ -24,6 +25,7 @@ import {
|
||||
isProcessing,
|
||||
isFormEntryDialogOpen,
|
||||
isRecordConfirmationOpen,
|
||||
onResetState,
|
||||
handleActionSave,
|
||||
handleActionEdit,
|
||||
handleActionRemove,
|
||||
@@ -48,6 +50,7 @@ const {
|
||||
fetchFn: async (params: any) => {
|
||||
const result = await getList({
|
||||
search: params.search,
|
||||
sort: 'createdAt:asc',
|
||||
'page-number': params['page-number'] || 0,
|
||||
'page-size': params['page-size'] || 10,
|
||||
includes: 'parent,childrens',
|
||||
@@ -127,7 +130,8 @@ watch(
|
||||
})
|
||||
if (result.success) {
|
||||
const currentData = result.body.data || []
|
||||
divisionsTrees.value = getValueTreeItems(currentData || [])
|
||||
const normalizedData = currentData.filter((division: Division) => !division.parent_id)
|
||||
divisionsTrees.value = getValueTreeItems(normalizedData)
|
||||
}
|
||||
},
|
||||
)
|
||||
@@ -156,6 +160,12 @@ onMounted(async () => {
|
||||
:title="!!recItem ? title : 'Tambah Divisi'"
|
||||
size="lg"
|
||||
prevent-outside
|
||||
@update:open="
|
||||
(value: any) => {
|
||||
onResetState()
|
||||
isFormEntryDialogOpen = value
|
||||
}
|
||||
"
|
||||
>
|
||||
<AppDivisionEntryForm
|
||||
:schema="DivisionSchema"
|
||||
|
||||
Reference in New Issue
Block a user