Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
beasy-mobile
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
4
Issues
4
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
G
beasy-mobile
Commits
a821cee3
Commit
a821cee3
authored
Sep 06, 2024
by
G
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
koffi updated his api response without saying a word. Again
parent
fc9ba58f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
transactions.ts
src/utils/requests/transactions.ts
+9
-2
No files found.
src/utils/requests/transactions.ts
View file @
a821cee3
...
...
@@ -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
<
Transaction
HistoryResponse
>
({
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
.
re
sults
.
re
verse
();
}
catch
(
error
)
{
log
.
error
(
"getTransactionsHistory |"
,
error
);
throw
error
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment