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