update list sucos
This commit is contained in:
@ -45,7 +45,7 @@ const AddDialog = () => {
|
||||
});
|
||||
const initialState = {
|
||||
name: '',
|
||||
posto_adm_id: 0,
|
||||
postoId: 0,
|
||||
created_by: '',
|
||||
created_at: ''
|
||||
};
|
||||
@ -80,7 +80,7 @@ const AddDialog = () => {
|
||||
const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {
|
||||
e.preventDefault();
|
||||
|
||||
if (formField.name.trim() === '' || formField.posto_adm_id === 0) {
|
||||
if (formField.name.trim() === '' || formField.postoId === 0) {
|
||||
setAlert({ show: true, message: 'Please fill in all required fields.' });
|
||||
return;
|
||||
}
|
||||
@ -166,7 +166,7 @@ const AddDialog = () => {
|
||||
<Popover open={open} onOpenChange={setOpen}>
|
||||
<PopoverTrigger asChild>
|
||||
<button type="button" className="input col-span-5 text-left">
|
||||
{posto_adms.find((posto) => posto.PostoAdms_id === formField.posto_adm_id)
|
||||
{posto_adms.find((posto) => posto.PostoAdms_id === formField.postoId)
|
||||
?.PostoAdms_name || 'Select Posto Administrativo'}
|
||||
</button>
|
||||
</PopoverTrigger>
|
||||
@ -183,7 +183,7 @@ const AddDialog = () => {
|
||||
onSelect={() => {
|
||||
setFormField({
|
||||
...formField,
|
||||
posto_adm_id: posto.PostoAdms_id
|
||||
postoId: posto.PostoAdms_id
|
||||
});
|
||||
setOpen(false);
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user