clean up some stuff, moved around other

This commit is contained in:
Maieul BOYER 2025-12-22 12:19:32 +01:00 committed by Maix0
parent 117b535962
commit 5615049a15
16 changed files with 80 additions and 84 deletions

View file

@ -1,6 +1,14 @@
import { ensureWindowState } from '@app/utils';
import { Configuration, OpenapiOtherApi } from './generated';
export * from './generated'
ensureWindowState();
declare module 'ft_state' {
interface State {
client: OpenapiOtherApi;
}
}
const basePath = (() => {
let u = new URL(location.href);
@ -8,11 +16,9 @@ const basePath = (() => {
u.hash = "";
u.search = "";
return u.toString().replace(/\/+$/, '');
})();
export const client = new OpenapiOtherApi(new Configuration({ basePath }));
export default client;
Object.assign(window as any, { apiClient: client });
window.__state.client ??= client;