fix(frontend): Remove ES6 exports from api.ts
Remove ES6 export statement from api.ts that was causing CommonJS
compilation in browsers, breaking window.api initialization.
Issue: TypeScript compiled 'export { ... }' to CommonJS format
(exports.apiGet = ...), which browsers don't support.
Fix: Remove export statement, rely on existing window.api assignment.
This produces browser-compatible JavaScript.
Before: export { getAuthHeader, apiGet, ... } → CommonJS exports
After: (window as any).api = { ... } → browser global
Resolves: 'Uncaught ReferenceError: exports is not defined'
Resolves: 'Uncaught TypeError: window.api is undefined'
This commit is contained in:
@@ -87,15 +87,3 @@ function handleError(error: unknown, context: string): void {
|
|||||||
handleVoidResponse,
|
handleVoidResponse,
|
||||||
handleError
|
handleError
|
||||||
};
|
};
|
||||||
|
|
||||||
export {
|
|
||||||
getAuthHeader,
|
|
||||||
apiGet,
|
|
||||||
apiPost,
|
|
||||||
apiPut,
|
|
||||||
apiDelete,
|
|
||||||
apiPatch,
|
|
||||||
handleResponse,
|
|
||||||
handleVoidResponse,
|
|
||||||
handleError
|
|
||||||
};
|
|
||||||
|
|||||||
Reference in New Issue
Block a user