fix formfield edit on manage provider

- set optional on transaction_type id and set default null
This commit is contained in:
Wikzyy
2025-04-17 11:06:02 +07:00
parent 1ecd62c777
commit 7b95761e92

View File

@ -155,11 +155,11 @@ const EditDialog = () => {
if (response?.status) { if (response?.status) {
setFormField((prev) => ({ setFormField((prev) => ({
...prev, ...prev,
name: response?.data.name, name: response?.data.name || null,
description: response?.data.description, description: response?.data.description,
type: response?.data.type, type: response?.data.type,
status: response?.data.status, status: response?.data.status,
transaction_type: response?.data.transaction_type.id, transaction_type: response?.data.transaction_type?.id || null,
agent: response?.data.agent?.id || null agent: response?.data.agent?.id || null
})); }));
} }
@ -174,7 +174,8 @@ const EditDialog = () => {
formField.description.trim() === '' || formField.description.trim() === '' ||
formField.type.trim() === '' || formField.type.trim() === '' ||
formField.status.trim() === '' || formField.status.trim() === '' ||
formField.transaction_type.trim() === '' formField.transaction_type.trim() === '' ||
formField.agent === null
) { ) {
setAlert({ show: true, message: 'Please fill in all required fields.' }); setAlert({ show: true, message: 'Please fill in all required fields.' });
return; return;