fix field name

This commit is contained in:
Wikzyy
2025-03-24 16:25:29 +07:00
parent 66c8654bcc
commit 0f7cd80e80

View File

@ -64,8 +64,8 @@ const AddDialog = () => {
description: '',
type: '',
status: '',
transactionTypeId: '',
agentId: '',
transaction_type: '',
agent: '',
created_by: '',
created_at: ''
};
@ -104,15 +104,15 @@ const AddDialog = () => {
formField.description.trim() === '' ||
formField.type.trim() === '' ||
formField.status.trim() === '' ||
formField.transactionTypeId.trim() === '' ||
formField.agentId.trim() === ''
formField.transaction_type === '' ||
formField.agent.trim() === ''
) {
setAlert({ show: true, message: 'Please fill in all required fields.' });
return;
}
doCreateProvider(e);
// console.log(formField);
console.log(formField);
setAlert({ show: false, message: '' });
};
@ -263,9 +263,9 @@ const AddDialog = () => {
Transaction Type Id<span className="text-red-500">*</span>
</label>
<Select
value={formField.transactionTypeId}
value={formField.transaction_type}
onValueChange={(value) =>
setFormField({ ...formField, transactionTypeId: value })
setFormField({ ...formField, transaction_type: value })
}
>
<SelectTrigger>
@ -290,7 +290,7 @@ const AddDialog = () => {
<Popover open={open} onOpenChange={setOpen}>
<PopoverTrigger asChild>
<button type="button" className="input col-span-5 text-left">
{customers.find((customer) => customer.msisdn === formField.agentId)
{customers.find((customer) => customer.msisdn === formField.agent)
?.fullname || 'Select Agent'}
</button>
</PopoverTrigger>
@ -307,7 +307,7 @@ const AddDialog = () => {
onSelect={() => {
setFormField({
...formField,
agentId: customer.msisdn
agent: customer.msisdn
});
setOpen(false);
}}