react-openapi and react-auth cleanup. index.ts for react-openapi
This commit is contained in:
@@ -113,15 +113,21 @@ function ResourceRouteWrapper() {
|
||||
return <ResourceView config={selectedResource} />;
|
||||
}
|
||||
|
||||
export default function Admin({ basePath = "/admin" }: { basePath?: string }) {
|
||||
interface AdminProps {
|
||||
basePath?: string;
|
||||
resourceOverrides?: Record<string, any>;
|
||||
profileConfig?: any;
|
||||
}
|
||||
|
||||
export default function Admin({ basePath = "/admin", resourceOverrides = {}, profileConfig = {} }: AdminProps) {
|
||||
const [config, setConfig] = React.useState<AppConfig | null>(null);
|
||||
|
||||
React.useEffect(() => {
|
||||
getAppConfig().then((cfg) => {
|
||||
getAppConfig(resourceOverrides, profileConfig).then((cfg) => {
|
||||
initializeApiClients(cfg.baseUrl, cfg.authBaseUrl);
|
||||
setConfig(cfg);
|
||||
});
|
||||
}, []);
|
||||
}, [resourceOverrides, profileConfig]);
|
||||
|
||||
if (!config) {
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user