react-openapi and react-auth cleanup. index.ts for react-openapi

This commit is contained in:
2026-04-04 18:01:22 +05:30
parent 86e5bc6429
commit ffa41825dd
15 changed files with 26 additions and 1733 deletions

View File

@@ -11,7 +11,8 @@ import {
Toolbar
} from "@mui/material";
import Home from './Home';
import Admin from '../react-openapi/Admin';
import { Admin, initializeApiClients } from '../react-openapi';
import { configuration, profileConfiguration } from './openapi-config';
import { Buffer } from 'buffer';
import process from 'process';
import { AuthProvider } from "../react-auth";
@@ -25,8 +26,12 @@ window.process = process;
const rootElement = document.getElementById('root');
const root = createRoot(rootElement);
const API_BASE = import.meta.env.VITE_API_BASE_URL;
const AUTH_BASE = import.meta.env.VITE_AUTH_BASE_URL;
// Initialize global API clients so all components across khata-ui have generic API access
initializeApiClients(API_BASE, AUTH_BASE);
const routerMapping = [
{ path: "/", component: Home, headerTitle: "Home" },
{ path: "/home", component: Home, headerTitle: "Home" },
@@ -50,7 +55,7 @@ root.render(
path={path}
element={
path.startsWith("/admin") ? (
<Component basePath="/admin" />
<Component basePath="/admin" resourceOverrides={configuration} profileConfig={profileConfiguration} />
) : (
<Component />
)