fix dletion
This commit is contained in:
@ -122,13 +122,18 @@ const ManageKycDeletionContextProvider = ({ children }: { children: React.ReactN
|
|||||||
limit,
|
limit,
|
||||||
page: page + 1,
|
page: page + 1,
|
||||||
with_deleted: false,
|
with_deleted: false,
|
||||||
order_field: "id",
|
order_field: "created_at",
|
||||||
order_direction: 'DESC',
|
order_direction: 'DESC',
|
||||||
filter: JSON.stringify(formattedFilter)
|
filter: JSON.stringify(formattedFilter)
|
||||||
});
|
});
|
||||||
|
let temp = 1;
|
||||||
|
let resDeletion = response?.data.list.map((el: any) => {
|
||||||
|
el.no = temp++;
|
||||||
|
return el;
|
||||||
|
});
|
||||||
|
|
||||||
setManageKyc(response?.data.list);
|
setManageKyc(resDeletion);
|
||||||
return { data: response?.data.list, totalCount: response?.data.total_count };
|
return { data: resDeletion, totalCount: response?.data.total_count };
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error fetching transaction', error);
|
console.error('Error fetching transaction', error);
|
||||||
}
|
}
|
||||||
@ -148,7 +153,6 @@ const ManageKycDeletionContextProvider = ({ children }: { children: React.ReactN
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const handleApproveReject = useCallback(async (customerDeletionId: string, status_approve: string) => {
|
const handleApproveReject = useCallback(async (customerDeletionId: string, status_approve: string) => {
|
||||||
console.log(customerDeletionId, status_approve)
|
|
||||||
try {
|
try {
|
||||||
let approveReject = await PostData(`${API_URL}/customer_deletion/update_status/${customerDeletionId}`, {
|
let approveReject = await PostData(`${API_URL}/customer_deletion/update_status/${customerDeletionId}`, {
|
||||||
status_approve
|
status_approve
|
||||||
@ -170,9 +174,9 @@ const ManageKycDeletionContextProvider = ({ children }: { children: React.ReactN
|
|||||||
const columns = useMemo<ColumnDef<any>[]>(
|
const columns = useMemo<ColumnDef<any>[]>(
|
||||||
() => [
|
() => [
|
||||||
{
|
{
|
||||||
accessorFn: (row) => row.id,
|
accessorFn: (row) => row.no,
|
||||||
id: 'id',
|
id: 'no',
|
||||||
header: ({ column }) => <DataGridColumnHeader title="ID" column={column} />,
|
header: ({ column }) => <DataGridColumnHeader title="No" column={column} />,
|
||||||
enableSorting: true,
|
enableSorting: true,
|
||||||
enableHiding: false,
|
enableHiding: false,
|
||||||
meta: {
|
meta: {
|
||||||
|
|||||||
Reference in New Issue
Block a user