mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-14 19:21:10 +02:00
fix(lightwrite): add /api/v1 prefix to backend API calls
The backend uses a global prefix of /api/v1 but the frontend was calling endpoints without it, causing 404 errors. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
497b12c561
commit
03d90f2bda
1 changed files with 5 additions and 4 deletions
|
|
@ -13,13 +13,14 @@ interface ProjectState {
|
|||
}
|
||||
|
||||
function getBackendUrl(): string {
|
||||
let baseUrl = 'http://localhost:3010';
|
||||
if (typeof window !== 'undefined') {
|
||||
return (
|
||||
baseUrl =
|
||||
(window as unknown as { __PUBLIC_BACKEND_URL__: string }).__PUBLIC_BACKEND_URL__ ||
|
||||
'http://localhost:3010'
|
||||
);
|
||||
'http://localhost:3010';
|
||||
}
|
||||
return 'http://localhost:3010';
|
||||
// Ensure API prefix is included
|
||||
return baseUrl.endsWith('/api/v1') ? baseUrl : `${baseUrl}/api/v1`;
|
||||
}
|
||||
|
||||
function createProjectStore() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue