update
This commit is contained in:
@ -209,7 +209,7 @@ const ShowDetailWalletDialog: React.FC<ShowDetailWalletDialogProps> = ({
|
||||
pageIndex: number;
|
||||
pageSize: number;
|
||||
sorting: Array<{ id: string; desc: boolean }>;
|
||||
columnFilters: any;
|
||||
columnFilters: any[];
|
||||
}): Promise<{ data: WalletTransaction[] }> => {
|
||||
// setIsLoading(true);
|
||||
const order_field = params.sorting.length ? params.sorting[0].id : 'date';
|
||||
@ -256,7 +256,9 @@ const ShowDetailWalletDialog: React.FC<ShowDetailWalletDialogProps> = ({
|
||||
fetchTransferType();
|
||||
}, []);
|
||||
|
||||
const handleApplyFilter = () => {
|
||||
useEffect(() => {
|
||||
if (!open) return;
|
||||
|
||||
const filters = [];
|
||||
|
||||
if (dateRange.from) filters.push({ id: 'date', value: { gte: dateRange.from } });
|
||||
@ -265,16 +267,13 @@ const ShowDetailWalletDialog: React.FC<ShowDetailWalletDialogProps> = ({
|
||||
if (selectedCategory) filters.push({ id: 'category', value: selectedCategory });
|
||||
if (searchValue) filters.push({ id: 'transaction_code', value: searchValue });
|
||||
|
||||
console.log(filters);
|
||||
|
||||
fetchData({
|
||||
pageIndex: 0,
|
||||
pageSize: 10,
|
||||
sorting: [{ id: 'date', desc: true }],
|
||||
columnFilters: JSON.stringify(filters),
|
||||
columnFilters: filters,
|
||||
});
|
||||
};
|
||||
|
||||
}, [dateRange, selectedTransferType, selectedCategory, searchValue, open]);
|
||||
|
||||
return (
|
||||
<Dialog open={open} onOpenChange={onClose}>
|
||||
@ -355,15 +354,6 @@ const ShowDetailWalletDialog: React.FC<ShowDetailWalletDialogProps> = ({
|
||||
<KeenIcon icon="arrow-circle-left" />
|
||||
</Button>
|
||||
</DefaultTooltip>
|
||||
<Button
|
||||
variant="default"
|
||||
className="h-8"
|
||||
onClick={handleApplyFilter}
|
||||
>
|
||||
<KeenIcon icon="filter" className="mr-2" />
|
||||
Apply Filter
|
||||
</Button>
|
||||
|
||||
</div>
|
||||
</div> */}
|
||||
|
||||
@ -391,4 +381,4 @@ const ShowDetailWalletDialog: React.FC<ShowDetailWalletDialogProps> = ({
|
||||
);
|
||||
};
|
||||
|
||||
export default ShowDetailWalletDialog;
|
||||
export default ShowDetailWalletDialog;
|
||||
Reference in New Issue
Block a user