From a821cee39307f5dc4e08b839ad214e8331971ea6 Mon Sep 17 00:00:00 2001 From: G Date: Fri, 6 Sep 2024 10:22:40 +0000 Subject: [PATCH] koffi updated his api response without saying a word. Again --- src/utils/requests/transactions.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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; -- libgit2 0.27.1