apiClient

This commit is contained in:
2025-11-22 15:30:08 +01:00
parent 530218a4b8
commit d3c76bc303
11 changed files with 319 additions and 169 deletions
+3 -2
View File
@@ -1,5 +1,6 @@
import React, { useContext, useEffect, useMemo, useReducer } from 'react';
import api from '../lib/api';
import { listTenants } from '../lib/apiClient';
type Tenant = Record<string, unknown> | null;
@@ -217,11 +218,11 @@ const AppStateProvider: React.FC<{ children?: React.ReactNode }> = ({ children }
}
try {
const { data } = await api.get('/tenants');
if (!abort) {
const tenants = await listTenants();
dispatch({
type: 'SET_TENANTS',
tenants: Array.isArray(data?.tenants) ? data.tenants : [],
tenants,
});
}
} catch (error) {