feat(division): parent id to default null
This commit is contained in:
@@ -35,8 +35,8 @@ const { defineField, errors, meta } = useForm({
|
|||||||
initialValues: {
|
initialValues: {
|
||||||
code: '',
|
code: '',
|
||||||
name: '',
|
name: '',
|
||||||
parent_id: 0,
|
parent_id: null,
|
||||||
division_id: 0,
|
division_id: null,
|
||||||
} as Partial<DivisionFormData>,
|
} as Partial<DivisionFormData>,
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -56,8 +56,8 @@ if (props.values) {
|
|||||||
const resetForm = () => {
|
const resetForm = () => {
|
||||||
code.value = ''
|
code.value = ''
|
||||||
name.value = ''
|
name.value = ''
|
||||||
parent.value = 0
|
parent.value = null
|
||||||
division.value = 0
|
division.value = null
|
||||||
}
|
}
|
||||||
|
|
||||||
// Form submission handler
|
// Form submission handler
|
||||||
@@ -65,8 +65,8 @@ function onSubmitForm() {
|
|||||||
const formData: DivisionFormData = {
|
const formData: DivisionFormData = {
|
||||||
name: name.value || '',
|
name: name.value || '',
|
||||||
code: code.value || '',
|
code: code.value || '',
|
||||||
parent_id: parent.value || 0,
|
parent_id: parent.value || null,
|
||||||
division_id: division.value || 0,
|
division_id: division.value || null,
|
||||||
}
|
}
|
||||||
emit('submit', formData, resetForm)
|
emit('submit', formData, resetForm)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ const {
|
|||||||
const result = await getDivisions({
|
const result = await getDivisions({
|
||||||
search: params.search,
|
search: params.search,
|
||||||
// page: params['page-number'] || 0,
|
// page: params['page-number'] || 0,
|
||||||
|
page_size: params['page-size'] || 100,
|
||||||
includes: 'parent,childrens',
|
includes: 'parent,childrens',
|
||||||
})
|
})
|
||||||
return { success: result.success || false, body: result.body || {} }
|
return { success: result.success || false, body: result.body || {} }
|
||||||
|
|||||||
Reference in New Issue
Block a user