expenses pagination fixes
This commit is contained in:
11
src/main.jsx
11
src/main.jsx
@@ -23,6 +23,7 @@ import { AuthProvider } from "../react-auth";
|
|||||||
import Header from './Header';
|
import Header from './Header';
|
||||||
import Footer from './Footer';
|
import Footer from './Footer';
|
||||||
import AppTheme from './shared-theme/AppTheme';
|
import AppTheme from './shared-theme/AppTheme';
|
||||||
|
import { specConfiguration } from './openapi-config';
|
||||||
|
|
||||||
const queryClient = new QueryClient();
|
const queryClient = new QueryClient();
|
||||||
|
|
||||||
@@ -33,14 +34,6 @@ const rootElement = document.getElementById('root');
|
|||||||
const root = createRoot(rootElement);
|
const root = createRoot(rootElement);
|
||||||
|
|
||||||
const AUTH_BASE = import.meta.env.VITE_AUTH_BASE_URL;
|
const AUTH_BASE = import.meta.env.VITE_AUTH_BASE_URL;
|
||||||
const API_BASE = import.meta.env.VITE_API_BASE_URL;
|
|
||||||
|
|
||||||
const specConfig = {
|
|
||||||
specUrl: `${API_BASE}/openapi.yaml`,
|
|
||||||
baseApiUrl: API_BASE,
|
|
||||||
title: 'Khata Admin',
|
|
||||||
getToken: () => localStorage.getItem('token'),
|
|
||||||
};
|
|
||||||
|
|
||||||
const routerMapping = [
|
const routerMapping = [
|
||||||
{ path: "/", component: Home, headerTitle: "Home" },
|
{ path: "/", component: Home, headerTitle: "Home" },
|
||||||
@@ -54,7 +47,7 @@ const routerMapping = [
|
|||||||
|
|
||||||
root.render(
|
root.render(
|
||||||
<QueryClientProvider client={queryClient}>
|
<QueryClientProvider client={queryClient}>
|
||||||
<AppProvider specConfiguration={specConfig}>
|
<AppProvider specConfiguration={specConfiguration}>
|
||||||
<BrowserRouter>
|
<BrowserRouter>
|
||||||
<AuthProvider authBaseUrl={AUTH_BASE}>
|
<AuthProvider authBaseUrl={AUTH_BASE}>
|
||||||
<AppTheme>
|
<AppTheme>
|
||||||
|
|||||||
16
src/openapi-config.ts
Normal file
16
src/openapi-config.ts
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
import type { SpecConfiguration } from "../react-openapi";
|
||||||
|
// import { tokenStore } from "../react-auth";
|
||||||
|
|
||||||
|
const apiBase = import.meta.env.VITE_API_BASE_URL;
|
||||||
|
|
||||||
|
export const specConfiguration: SpecConfiguration = {
|
||||||
|
specUrl: `${apiBase}/openapi.json`,
|
||||||
|
baseApiUrl: apiBase,
|
||||||
|
title: "Khata",
|
||||||
|
resourceConfig: {
|
||||||
|
expenses: {
|
||||||
|
filterOptions: { mode: "client" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
// getToken: () => tokenStore.get(),
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user