created transaction list show and create a custom card

This commit is contained in:
Jaanu423
2025-09-25 15:44:58 +05:30
parent 7f95ae73a0
commit fb55686724
10 changed files with 569 additions and 10 deletions
+7 -2
View File
@@ -1,4 +1,5 @@
import axios, { AxiosRequestConfig } from "axios";
import { Alert, ToastAndroid } from "react-native";
import * as Keychain from "react-native-keychain";
/**
@@ -12,7 +13,8 @@ export async function apiCall<T>(
url: string,
method: "GET" | "POST" | "PUT" | "DELETE" = "GET",
data?: any,
config?: AxiosRequestConfig
config?: AxiosRequestConfig,
responseErrorMessage?:string
): Promise<T | null > {
try {
// Get saved credentials from Keychain
@@ -41,12 +43,15 @@ export async function apiCall<T>(
`Status: ${error.response.status}`,
`Data: ${JSON.stringify(error.response.data)}`
);
if(error.response.status === 400){
ToastAndroid.show(error.response.data.message || responseErrorMessage, ToastAndroid.SHORT)
}
} else if (error.request) {
// Request was made but no response received
console.error("API Error: No response received", error.request);
} else {
// Something else went wrong while setting up the request
console.error("API Error:", error.message);
console.error("API Error:", error);
}
return null; // return null so the caller can handle it
}
+1
View File
@@ -19,3 +19,4 @@ export const USER_REQUEST = `${BASE_URL}fund/my-requests`
export const GROUP_ALL_MEMBER = `${BASE_URL}fund/group/all/member`
export const UPDATE_BANK_URL = `${BASE_URL}user/bank/update`;
export const CONTRIBUTE = `${BASE_URL}payments/groups/`;
export const TRANSACTION = `${BASE_URL}payments/my-transactions`;