fix(Issuer): correct AllowedCurrencies and Capabilities structure
This commit is contained in:
43
src/services/generalAPI.js
Normal file
43
src/services/generalAPI.js
Normal file
@@ -0,0 +1,43 @@
|
||||
import api from './apiClient';
|
||||
|
||||
// -----------------------------
|
||||
// General API
|
||||
// -----------------------------
|
||||
export const generalAPI = {
|
||||
// GET /api/v1/General/Currencies
|
||||
async getCurrencies() {
|
||||
try {
|
||||
const res = await api.get('/api/v1/General/Currencies', { skipAuthRedirect: true });
|
||||
// پاسخ به صورت array مستقیم است
|
||||
return Array.isArray(res?.data) ? res?.data : [];
|
||||
} catch (error) {
|
||||
console.error('🔴 General API - getCurrencies error:', error);
|
||||
throw error;
|
||||
}
|
||||
},
|
||||
|
||||
// GET /api/v1/General/TimeZones
|
||||
async getTimeZones() {
|
||||
try {
|
||||
const res = await api.get('/api/v1/General/TimeZones', { skipAuthRedirect: true });
|
||||
// پاسخ به صورت { data: [...], statusCode: 200, ... } است
|
||||
return res?.data?.data || [];
|
||||
} catch (error) {
|
||||
console.error('🔴 General API - getTimeZones error:', error);
|
||||
throw error;
|
||||
}
|
||||
},
|
||||
|
||||
// GET /api/v1/General/IssuerCapabilities
|
||||
async getIssuerCapabilities() {
|
||||
try {
|
||||
const res = await api.get('/api/v1/General/IssuerCapabilities', { skipAuthRedirect: true });
|
||||
// پاسخ به صورت { data: [...], statusCode: 200, ... } است
|
||||
return res?.data?.data || [];
|
||||
} catch (error) {
|
||||
console.error('🔴 General API - getIssuerCapabilities error:', error);
|
||||
throw error;
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user