feat(division): parent id to default null
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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 || {} }
|
||||
|
||||
Reference in New Issue
Block a user