Commit a821cee3 by G

koffi updated his api response without saying a word. Again

parent fc9ba58f
......@@ -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<Transaction[]> => {
const basictoken = base64.encode("admin:admin");
log.http("getTransactionsHistory");
try {
const response = await axiosRequest<Transaction[]>({
const response = await axiosRequest<TransactionHistoryResponse>({
url: "/transactions/",
headers: {
// biome-ignore lint/style/useNamingConvention: <explanation>
......@@ -42,7 +49,7 @@ export const getTransactionsHistory = async (): Promise<Transaction[]> => {
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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment