diff --git a/src/api/requests/contact.ts b/src/api/requests/contact.ts index cc81feb..e1ce542 100644 --- a/src/api/requests/contact.ts +++ b/src/api/requests/contact.ts @@ -1,10 +1,12 @@ -/* eslint-disable @typescript-eslint/no-unused-vars */ + import { PaginationParams } from '../types'; import { Contact, ContactMetadata } from '../types/contact'; import axios from 'axios'; -export const searchContacts = async (_pagination?: PaginationParams) => { - const { data: response } = await axios.get(`/contact/search`); +export const searchContacts = async (pagination?: PaginationParams) => { + const { data: response } = await axios.post(`/contact/search`, { + params: pagination + }); return response; }; diff --git a/src/api/requests/transaction.ts b/src/api/requests/transaction.ts index acaed5b..96b9c56 100644 --- a/src/api/requests/transaction.ts +++ b/src/api/requests/transaction.ts @@ -3,7 +3,7 @@ import { SendNewTransaction } from '@/api/types'; import { PaginationParams } from '../types/pagination'; export const getTransactions = async (pagination: PaginationParams) => { - const { data: response } = await axios.get(`/transaction`, { + const { data: response } = await axios.post(`/transaction/search`, { params: pagination, }); if (response != null && typeof response !== 'object') { diff --git a/src/providers/contacts/provider.tsx b/src/providers/contacts/provider.tsx index d83e12c..c1f3a78 100644 --- a/src/providers/contacts/provider.tsx +++ b/src/providers/contacts/provider.tsx @@ -1,5 +1,6 @@ import { searchContacts } from '@/api/requests/contact'; import { Contact } from '@/api/types/contact'; +import { PaginationParams } from '@/api/types'; import { usePikeEnabled } from '@/hooks/useFeatureFlags'; import { FC, PropsWithChildren, createContext, useCallback, useEffect, useMemo, useState } from 'react'; import { useAuthorization } from '../authorization'; @@ -26,8 +27,14 @@ export const ContactsProvider: FC = ({ children }) => { } setLoading(true); try { - const contacts = await searchContacts(); - setContacts(contacts); + const paginationParams : PaginationParams = { + page: 1, + page_size: 1000, + order: 'paymail', + sort: 'asc', + } + const contactsResponse = await searchContacts(paginationParams); + setContacts(contactsResponse.content); } catch { setContacts(null); setError(true);