fix customer
This commit is contained in:
@ -487,10 +487,13 @@ const EditFeeDialog = () => {
|
||||
</Select>
|
||||
</div> */}
|
||||
<div className="flex justify-end pt-2.5 gap-5">
|
||||
<Button variant={'outline'} type="reset"
|
||||
<Button
|
||||
variant={'outline'}
|
||||
type="reset"
|
||||
onClick={() => {
|
||||
resetForm();
|
||||
}}>
|
||||
}}
|
||||
>
|
||||
Reset
|
||||
</Button>
|
||||
<Button variant={'default'} type="submit" disabled={isSubmitting}>
|
||||
|
||||
@ -199,7 +199,9 @@ const AddDialog = () => {
|
||||
<DialogDescription></DialogDescription>
|
||||
<div className="flex items-center justify-between flex-wrap grow">
|
||||
<div className="flex flex-col justify-center">
|
||||
<h1 className="text-xl font-semibold leading-none text-gray-900">Addd Transaction Type</h1>
|
||||
<h1 className="text-xl font-semibold leading-none text-gray-900">
|
||||
Addd Transaction Type
|
||||
</h1>
|
||||
<div className="flex items-center gap-2 text-sm font-normal text-gray-700"></div>
|
||||
</div>
|
||||
<div
|
||||
|
||||
@ -506,10 +506,13 @@ const EditDialog = () => {
|
||||
Transaction Fee Form
|
||||
</Button> */}
|
||||
|
||||
<Button variant={'outline'} type="reset"
|
||||
<Button
|
||||
variant={'outline'}
|
||||
type="reset"
|
||||
onClick={() => {
|
||||
resetForm();
|
||||
}}>
|
||||
}}
|
||||
>
|
||||
Reset
|
||||
</Button>
|
||||
<Button variant={'default'} type="submit" disabled={isSubmitting}>
|
||||
|
||||
@ -6,7 +6,6 @@
|
||||
import { createContext, useCallback, useEffect, useMemo, useState } from 'react';
|
||||
import ListToolbar from '../blocks/ListToolBar';
|
||||
|
||||
|
||||
interface AccountProps {
|
||||
id: string;
|
||||
name: string;
|
||||
@ -60,7 +59,6 @@
|
||||
const [selectedTransferType, setSelectedTransferType] = useState<string | null>(null);
|
||||
const [transferType, setTransferType] = useState<string | null>(null);
|
||||
|
||||
|
||||
const handleEditDialog = useCallback((show: boolean, selected_transfertype: string | null) => {
|
||||
setSelectedTransferType(show ? selected_transfertype : null);
|
||||
setShowEditDialog(show);
|
||||
@ -77,11 +75,12 @@
|
||||
|
||||
const columns = useMemo<ColumnDef<any>[]>(
|
||||
() => [
|
||||
|
||||
{
|
||||
accessorFn: (row) => row.name,
|
||||
id: 'name',
|
||||
header: ({ column }) => <DataGridColumnHeader title="Transaction Type Name" column={column} />,
|
||||
header: ({ column }) => (
|
||||
<DataGridColumnHeader title="Transaction Type Name" column={column} />
|
||||
),
|
||||
enableSorting: true,
|
||||
enableHiding: false,
|
||||
meta: { headerClassName: 'w-[250px]' }
|
||||
@ -121,7 +120,9 @@
|
||||
{
|
||||
accessorFn: (row) => row.max_transaction_per_day,
|
||||
id: 'max_transaction_per_day',
|
||||
header: ({ column }) => <DataGridColumnHeader title="Max Transaction Per Day" column={column} />,
|
||||
header: ({ column }) => (
|
||||
<DataGridColumnHeader title="Max Transaction Per Day" column={column} />
|
||||
),
|
||||
enableSorting: true,
|
||||
enableHiding: false,
|
||||
meta: { headerClassName: 'w-[250px]' }
|
||||
@ -137,7 +138,9 @@
|
||||
{
|
||||
accessorFn: (row) => row.wallet_fee_destination.name,
|
||||
id: 'wallet_fee_destination',
|
||||
header: ({ column }) => <DataGridColumnHeader title="Wallet Fee Destination" column={column} />,
|
||||
header: ({ column }) => (
|
||||
<DataGridColumnHeader title="Wallet Fee Destination" column={column} />
|
||||
),
|
||||
enableSorting: true,
|
||||
enableHiding: false,
|
||||
meta: { headerClassName: 'w-[250px]' }
|
||||
@ -145,7 +148,9 @@
|
||||
{
|
||||
accessorFn: (row) => row.customer_fee_destination?.username || 'N/A',
|
||||
id: 'customer_fee_destination',
|
||||
header: ({ column }) => <DataGridColumnHeader title="Customer Fee Destination" column={column} />,
|
||||
header: ({ column }) => (
|
||||
<DataGridColumnHeader title="Customer Fee Destination" column={column} />
|
||||
),
|
||||
enableSorting: true,
|
||||
enableHiding: false,
|
||||
meta: { headerClassName: 'w-[250px]' }
|
||||
@ -165,8 +170,7 @@
|
||||
enableSorting: true,
|
||||
enableHiding: false,
|
||||
meta: { headerClassName: 'w-[150px]' }
|
||||
}
|
||||
,
|
||||
},
|
||||
{
|
||||
id: 'actions',
|
||||
header: ({ column }) => <DataGridColumnHeader title="Actions" column={column} />,
|
||||
@ -176,10 +180,16 @@
|
||||
const row = data.row.original;
|
||||
return (
|
||||
<>
|
||||
<button className="btn btn-sm btn-icon btn-clear btn-light" onClick={() => handleEditDialog(true, row.id)}>
|
||||
<button
|
||||
className="btn btn-sm btn-icon btn-clear btn-light"
|
||||
onClick={() => handleEditDialog(true, row.id)}
|
||||
>
|
||||
<KeenIcon icon="notepad-edit" />
|
||||
</button>
|
||||
<button className="btn btn-sm btn-icon btn-clear btn-light" onClick={() => handleDeleteDialog(true, row.id)}>
|
||||
<button
|
||||
className="btn btn-sm btn-icon btn-clear btn-light"
|
||||
onClick={() => handleDeleteDialog(true, row.id)}
|
||||
>
|
||||
<KeenIcon icon="trash" />
|
||||
</button>
|
||||
</>
|
||||
@ -190,8 +200,12 @@
|
||||
],
|
||||
[handleEditDialog, handleDeleteDialog]
|
||||
);
|
||||
const doGetTransferTypeListData = async (page: number, limit: number, sorting: any, filter: any) => {
|
||||
|
||||
const doGetTransferTypeListData = async (
|
||||
page: number,
|
||||
limit: number,
|
||||
sorting: any,
|
||||
filter: any
|
||||
) => {
|
||||
sorting = sorting.length == 0 ? [{ id: 'id', desc: false }] : sorting;
|
||||
filter = filter.length == 0 ? {} : { any: filter[0].value?.toLowerCase() };
|
||||
const response = await GetData(`${API_URL}/transactiontype/list`, {
|
||||
@ -203,11 +217,10 @@
|
||||
filter: JSON.stringify(filter)
|
||||
});
|
||||
return { data: response?.data.list, totalCount: response?.data.total_count };
|
||||
};
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="min-h-screen">
|
||||
|
||||
<ManageTransferTypeContext.Provider
|
||||
value={{
|
||||
showEditDialog,
|
||||
@ -218,7 +231,7 @@
|
||||
handleDeleteDialog,
|
||||
selectedTransferType,
|
||||
accounts,
|
||||
transferType,
|
||||
transferType
|
||||
}}
|
||||
>
|
||||
<Toaster expand visibleToasts={9} duration={3000} />
|
||||
@ -241,7 +254,6 @@
|
||||
</ManageTransferTypeContext.Provider>
|
||||
</div>
|
||||
);
|
||||
|
||||
};
|
||||
|
||||
export { ManageTransferTypeContext, ManageTransferTypeContextProvider };
|
||||
|
||||
Reference in New Issue
Block a user