fix define row to match with response
This commit is contained in:
@ -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