apiClient
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user