diff --git a/src/pages/master/aldeias/blocks/AddDialog.tsx b/src/pages/master/aldeias/blocks/AddDialog.tsx index 731ceba..f678f33 100644 --- a/src/pages/master/aldeias/blocks/AddDialog.tsx +++ b/src/pages/master/aldeias/blocks/AddDialog.tsx @@ -46,7 +46,7 @@ const AddDialog = () => { }); const initialState = { name: '', - sucos_id: 0, + sucosId: 0, created_by: '', created_at: '' }; @@ -99,7 +99,7 @@ const AddDialog = () => { const handleSubmit = (e: React.FormEvent) => { e.preventDefault(); - if (formField.name === '' || formField.sucos_id === 0) { + if (formField.name === '' || formField.sucosId === 0) { setAlert({ show: true, message: 'Please fill in all required fields.' }); return; } @@ -168,7 +168,7 @@ const AddDialog = () => { @@ -184,11 +184,11 @@ const AddDialog = () => { {sucos.map((suco) => ( { setFormField({ ...formField, - sucos_id: suco.sucos_id + sucosId: suco.sucos_id }); setOpen(false); }} diff --git a/src/pages/master/aldeias/blocks/EditDialog.tsx b/src/pages/master/aldeias/blocks/EditDialog.tsx index d69981e..449197d 100644 --- a/src/pages/master/aldeias/blocks/EditDialog.tsx +++ b/src/pages/master/aldeias/blocks/EditDialog.tsx @@ -45,7 +45,7 @@ const EditDialog = () => { }); const initialState = { name: '', - sucos_id: 0, + sucosId: 0, updated_by: '', updated_at: '' }; @@ -102,13 +102,13 @@ const EditDialog = () => { setFormField((prev) => ({ ...prev, name: response.data.name, - sucos_id: response.data.sucos.id + sucosId: response.data.sucos.id })); } else { setFormField((prev) => ({ ...prev, name: '', - sucos_id: 0 + sucosId: 0 })); } }, []); @@ -116,7 +116,7 @@ const EditDialog = () => { const handleUpdate = (e: React.FormEvent) => { e.preventDefault(); - if (formField.name === '' || formField.sucos_id === 0) { + if (formField.name === '' || formField.sucosId === 0) { setAlert({ show: true, message: 'Please fill in all required fields.' }); return; } @@ -191,7 +191,7 @@ const EditDialog = () => { @@ -208,7 +208,7 @@ const EditDialog = () => { onSelect={() => { setFormField({ ...formField, - sucos_id: suco.sucos_id + sucosId: suco.sucos_id }); setOpen(false); }}