complete award page - score - transactions not complete

This commit is contained in:
Alihaghighattalab
2024-08-17 11:14:21 +03:30
parent 2a54970b12
commit 49cd5faf9d
10 changed files with 101 additions and 45 deletions
+2 -13
View File
@@ -1,17 +1,6 @@
import { AwardsResponse } from "../../types";
import axiosInstance from "../axios";
export interface AwardsResponse {
_id: string,
score: number,
title: string,
desc: string,
expireDate: string,
created_at: string,
updated_at: string,
__v: number,
id: string
}
export const getAwardsList = () => axiosInstance.get<AwardsResponse[] | AwardsResponse | []>("/gps/award")
export const getAwardsList = () => axiosInstance.get<AwardsResponse[] | AwardsResponse | [], any>("/gps/award")
+3 -4
View File
@@ -1,6 +1,6 @@
import axiosInstance from "../axios";
export type ScoreDataResponse = {
export type ScoreData = {
_id: string,
deviceId: string,
score: number,
@@ -11,12 +11,11 @@ export type ScoreDataResponse = {
id: string
}
export interface ScoreResponse {
data: ScoreDataResponse[] | []
data: ScoreData[] | []
score: number,
total: number
}
export const getScoresList = () => axiosInstance.get<ScoreResponse>("/gps/score")
export const getScoresList = () => axiosInstance.get<ScoreData, any>("/gps/score")
+28 -1
View File
@@ -1,3 +1,30 @@
import axiosInstance from "../axios";
export const getTransactionsList = () => axiosInstance.get<any>("/gps/transactions")
export interface TransactionsResponse {
data: TransactionsData[] | []
}
export interface TransactionsData {
_id: string,
card: TransactionsCard
userId: string,
amount: number,
dollarAmount: number,
status: number,
created_at: string,
updated_at: string,
__v: number,
id: string
}
export interface TransactionsCard {
_id: string,
holderName: string,
PAN: number,
IBAN: string,
created_at: string,
updated_at: string,
id: string
}
export const getTransactionsList = () => axiosInstance.get<TransactionsResponse>("/gps/transactions")