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