fix variable to props on sucos
This commit is contained in:
@ -27,8 +27,8 @@ import {
|
||||
import { doSaveLogActivity } from '@/actions/GlobalActions';
|
||||
|
||||
interface SucosProps {
|
||||
sucos_id: number;
|
||||
sucos_name: string;
|
||||
id: number;
|
||||
name: string;
|
||||
}
|
||||
|
||||
const API_URL = apiConfig.service_master_data;
|
||||
@ -97,8 +97,8 @@ const EditDialog = () => {
|
||||
order_direction: sorting[0].desc == false ? 'ASC' : 'DESC'
|
||||
});
|
||||
|
||||
// console.log('SUCOS', response?.data);
|
||||
setSucos(response?.data.list);
|
||||
console.log(sucos);
|
||||
} catch (error) {
|
||||
console.error('Error fetching Sucos', error);
|
||||
setAlert({ show: true, message: 'Failed to get Sucos. Please try again.' });
|
||||
@ -221,8 +221,8 @@ const EditDialog = () => {
|
||||
className="input col-span-5 text-left"
|
||||
style={{ color: 'inherit' }}
|
||||
>
|
||||
{sucos.find((suco) => suco.sucos_id === formField.sucosId)
|
||||
?.sucos_name || 'Select Sucos'}
|
||||
{sucos.find((suco) => suco.id === formField.sucosId)
|
||||
?.name || 'Select Sucos'}
|
||||
</button>
|
||||
</PopoverTrigger>
|
||||
<PopoverContent className="w-[400px] p-0">
|
||||
@ -233,17 +233,17 @@ const EditDialog = () => {
|
||||
<CommandGroup>
|
||||
{sucos.map((suco) => (
|
||||
<CommandItem
|
||||
key={suco.sucos_id}
|
||||
value={suco.sucos_name}
|
||||
key={suco.id}
|
||||
value={suco.name}
|
||||
onSelect={() => {
|
||||
setFormField({
|
||||
...formField,
|
||||
sucosId: suco.sucos_id
|
||||
sucosId: suco.id
|
||||
});
|
||||
setOpen(false);
|
||||
}}
|
||||
>
|
||||
{suco.sucos_name}
|
||||
{suco.name}
|
||||
</CommandItem>
|
||||
))}
|
||||
</CommandGroup>
|
||||
|
||||
Reference in New Issue
Block a user