diff --git a/src/utils/requests/transactions.ts b/src/utils/requests/transactions.ts index 546cb16..bb723b9 100644 --- a/src/utils/requests/transactions.ts +++ b/src/utils/requests/transactions.ts @@ -26,12 +26,19 @@ export interface Transaction { marchand_code: string; } +export interface TransactionHistoryResponse { + count: number; + next: string | null; + previous: string | null; + results: Transaction[]; +} + export const getTransactionsHistory = async (): Promise => { const basictoken = base64.encode("admin:admin"); log.http("getTransactionsHistory"); try { - const response = await axiosRequest({ + const response = await axiosRequest({ url: "/transactions/", headers: { // biome-ignore lint/style/useNamingConvention: @@ -42,7 +49,7 @@ export const getTransactionsHistory = async (): Promise => { log.http("getTransactionsHistory |", JSON.stringify(response, null, 2)); // TODO: Update this when the api is fixed, response should not be reversed - return response.reverse(); + return response.results.reverse(); } catch (error) { log.error("getTransactionsHistory |", error); throw error;