From b0c5332d77e0b26c0c008bd9496268c9a285fb16 Mon Sep 17 00:00:00 2001 From: Vishesh 'ironeagle' Bangotra Date: Thu, 18 Jun 2026 23:37:56 +0530 Subject: [PATCH] expenses pagination fixes --- src/main.jsx | 11 ++--------- src/openapi-config.ts | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 9 deletions(-) create mode 100644 src/openapi-config.ts diff --git a/src/main.jsx b/src/main.jsx index 51c64a7..b71cbf8 100644 --- a/src/main.jsx +++ b/src/main.jsx @@ -23,6 +23,7 @@ import { AuthProvider } from "../react-auth"; import Header from './Header'; import Footer from './Footer'; import AppTheme from './shared-theme/AppTheme'; +import { specConfiguration } from './openapi-config'; const queryClient = new QueryClient(); @@ -33,14 +34,6 @@ const rootElement = document.getElementById('root'); const root = createRoot(rootElement); 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 = [ { path: "/", component: Home, headerTitle: "Home" }, @@ -54,7 +47,7 @@ const routerMapping = [ root.render( - + diff --git a/src/openapi-config.ts b/src/openapi-config.ts new file mode 100644 index 0000000..3fd7c24 --- /dev/null +++ b/src/openapi-config.ts @@ -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(), +};