feat(division): parent id to default null

This commit is contained in:
riefive
2025-10-03 14:47:02 +07:00
parent f374f9ef5b
commit 2d8c751788
2 changed files with 7 additions and 6 deletions
+6 -6
View File
@@ -35,8 +35,8 @@ const { defineField, errors, meta } = useForm({
initialValues: {
code: '',
name: '',
parent_id: 0,
division_id: 0,
parent_id: null,
division_id: null,
} as Partial<DivisionFormData>,
})
@@ -56,8 +56,8 @@ if (props.values) {
const resetForm = () => {
code.value = ''
name.value = ''
parent.value = 0
division.value = 0
parent.value = null
division.value = null
}
// Form submission handler
@@ -65,8 +65,8 @@ function onSubmitForm() {
const formData: DivisionFormData = {
name: name.value || '',
code: code.value || '',
parent_id: parent.value || 0,
division_id: division.value || 0,
parent_id: parent.value || null,
division_id: division.value || null,
}
emit('submit', formData, resetForm)
}
+1
View File
@@ -51,6 +51,7 @@ const {
const result = await getDivisions({
search: params.search,
// page: params['page-number'] || 0,
page_size: params['page-size'] || 100,
includes: 'parent,childrens',
})
return { success: result.success || false, body: result.body || {} }