update: update trading page history to use updated getUserOrders endpoint

This commit is contained in:
Andrew Besedin 2026-02-17 11:05:59 +03:00
parent abb9e0a476
commit 451e53e244

View file

@ -16,6 +16,7 @@ import { countByKeyRecord, createOrderSorter } from '@/utils/utils';
import ApplyTip from '@/interfaces/common/ApplyTip'; import ApplyTip from '@/interfaces/common/ApplyTip';
import { useQuerySyncedTab } from '@/hook/useQuerySyncedTab'; import { useQuerySyncedTab } from '@/hook/useQuerySyncedTab';
import { useMediaQuery } from '@/hook/useMediaQuery'; import { useMediaQuery } from '@/hook/useMediaQuery';
import { GetUserOrdersBodyStatus } from '@/interfaces/fetch-data/get-user-orders/GetUserOrdersData';
import { UserOrdersProps } from './types'; import { UserOrdersProps } from './types';
import styles from './styles.module.scss'; import styles from './styles.module.scss';
import { import {
@ -73,7 +74,7 @@ const UserOrders = ({
length: offers.length, length: offers.length,
}, },
{ {
title: 'History', title: 'History - Last 100 Items',
type: 'history', type: 'history',
length: ordersHistory.length, length: ordersHistory.length,
}, },
@ -105,7 +106,13 @@ const UserOrders = ({
})(); })();
(async () => { (async () => {
const result = await getUserOrders(); const result = await getUserOrders({
limit: 100,
offset: 0,
filterInfo: {
status: GetUserOrdersBodyStatus.FINISHED,
},
});
if (!result.success) { if (!result.success) {
setAlertState('error'); setAlertState('error');
@ -116,9 +123,7 @@ const UserOrders = ({
return; return;
} }
const filteredOrdersHistory = result.data const filteredOrdersHistory = result.data.filter((s) => s.status === 'finished');
.filter((s) => s.pair_id === pairData?.id)
.filter((s) => s.status === 'finished');
fetchUser(); fetchUser();