Merge branch 'alwi'
This commit is contained in:
@ -56,7 +56,7 @@ const EditDialog = () => {
|
||||
type: '',
|
||||
status: '',
|
||||
transactionTypeId: '',
|
||||
agentId: '',
|
||||
agent: '',
|
||||
updated_by: '',
|
||||
updated_at: ''
|
||||
};
|
||||
@ -128,7 +128,7 @@ const EditDialog = () => {
|
||||
|
||||
const doFetchData = useCallback(async (id: string) => {
|
||||
const response = await GetData(`${API_URL_MASTERDATA}/provider/getdata/${id}`, { id });
|
||||
|
||||
console.log(response);
|
||||
if (response?.status) {
|
||||
setFormField((prev) => ({
|
||||
...prev,
|
||||
@ -137,7 +137,7 @@ const EditDialog = () => {
|
||||
type: response?.data.type,
|
||||
status: response?.data.status,
|
||||
transactionTypeId: response?.data.transactionTypeId,
|
||||
agentId: response?.data.agentId
|
||||
agent: response?.data.agent
|
||||
}));
|
||||
}
|
||||
}, []);
|
||||
@ -151,7 +151,7 @@ const EditDialog = () => {
|
||||
formField.type.trim() === '' ||
|
||||
formField.status.trim() === '' ||
|
||||
formField.transactionTypeId.trim() === '' ||
|
||||
formField.agentId.trim() === ''
|
||||
formField.agent.trim() === ''
|
||||
) {
|
||||
setAlert({ show: true, message: 'Please fill in all required fields.' });
|
||||
return;
|
||||
@ -309,7 +309,7 @@ const EditDialog = () => {
|
||||
<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>
|
||||
@ -326,7 +326,7 @@ const EditDialog = () => {
|
||||
onSelect={() => {
|
||||
setFormField({
|
||||
...formField,
|
||||
agentId: customer.msisdn
|
||||
agent: customer.msisdn
|
||||
});
|
||||
setOpen(false);
|
||||
}}
|
||||
|
||||
@ -74,7 +74,7 @@ const ManageProviderContextProvider = ({ children }: { children: React.ReactNode
|
||||
const columns = useMemo<ColumnDef<any>[]>(
|
||||
() => [
|
||||
{
|
||||
accessorFn: (row) => row.id,
|
||||
accessorFn: (row) => row.provider_id,
|
||||
id: 'id',
|
||||
header: ({ column }) => <DataGridColumnHeader title="ID" column={column} />,
|
||||
enableSorting: true,
|
||||
@ -84,7 +84,7 @@ const ManageProviderContextProvider = ({ children }: { children: React.ReactNode
|
||||
}
|
||||
},
|
||||
{
|
||||
accessorFn: (row) => row.name,
|
||||
accessorFn: (row) => row.provider_name,
|
||||
id: 'name',
|
||||
header: ({ column }) => <DataGridColumnHeader title="Name" column={column} />,
|
||||
enableSorting: true,
|
||||
@ -94,7 +94,7 @@ const ManageProviderContextProvider = ({ children }: { children: React.ReactNode
|
||||
}
|
||||
},
|
||||
{
|
||||
accessorFn: (row) => row.description,
|
||||
accessorFn: (row) => row.provider_description,
|
||||
id: 'description',
|
||||
header: ({ column }) => <DataGridColumnHeader title="Description" column={column} />,
|
||||
enableSorting: false,
|
||||
@ -104,7 +104,7 @@ const ManageProviderContextProvider = ({ children }: { children: React.ReactNode
|
||||
}
|
||||
},
|
||||
{
|
||||
accessorFn: (row) => row.type,
|
||||
accessorFn: (row) => row.provider_type,
|
||||
id: 'type',
|
||||
header: ({ column }) => <DataGridColumnHeader title="Type" column={column} />,
|
||||
enableSorting: false,
|
||||
@ -114,7 +114,7 @@ const ManageProviderContextProvider = ({ children }: { children: React.ReactNode
|
||||
}
|
||||
},
|
||||
{
|
||||
accessorFn: (row) => row.status,
|
||||
accessorFn: (row) => row.provider_status,
|
||||
id: 'status',
|
||||
header: ({ column }) => <DataGridColumnHeader title="Status" column={column} />,
|
||||
enableSorting: false,
|
||||
@ -134,13 +134,13 @@ const ManageProviderContextProvider = ({ children }: { children: React.ReactNode
|
||||
<>
|
||||
<button
|
||||
className="btn btn-sm btn-icon btn-clear btn-light"
|
||||
onClick={() => handleEditDialog(true, row.id)}
|
||||
onClick={() => handleEditDialog(true, row.provider_id)}
|
||||
>
|
||||
<KeenIcon icon="notepad-edit" />
|
||||
</button>
|
||||
<button
|
||||
className="btn btn-sm btn-icon btn-clear btn-light"
|
||||
onClick={() => handleDeleteDialog(true, row.id)}
|
||||
onClick={() => handleDeleteDialog(true, row.provider_id)}
|
||||
>
|
||||
<KeenIcon icon="trash" />
|
||||
</button>
|
||||
@ -168,7 +168,7 @@ const ManageProviderContextProvider = ({ children }: { children: React.ReactNode
|
||||
order_direction: sorting[0].desc == false ? 'ASC' : 'DESC',
|
||||
filter: JSON.stringify(filter)
|
||||
});
|
||||
// console.log(response?.data);
|
||||
console.log(response?.data);
|
||||
setProvider(response?.data.list);
|
||||
return { data: response?.data.list, totalCount: response?.data.total_count };
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user