I also hardened the dashboard API helper so a bare origin
Build & Deploy / Build & Push Docker Image (push) Successful in 2m47s
Test / Type Check (all packages) (push) Successful in 54s
Build & Deploy / Deploy to VPS (push) Successful in 3s
Test / API Unit Tests (push) Successful in 47s
Test / Homepage Unit Tests (push) Successful in 44s
Test / Storefront Unit Tests (push) Successful in 42s
Test / Admin Unit Tests (push) Successful in 41s
Test / Dashboard Unit Tests (push) Successful in 42s
Test / API Integration Tests (push) Successful in 1m0s

This commit is contained in:
root
2026-07-02 01:43:27 -04:00
parent 56984c4ea7
commit 8ef61d7005
2 changed files with 24 additions and 2 deletions
+8 -2
View File
@@ -1,7 +1,13 @@
export const API_BASE =
function normalizeApiBase(value: string): string {
const base = value.replace(/\/+$/, '')
return /\/api\/v1$/.test(base) ? base : `${base}/api/v1`
}
export const API_BASE = normalizeApiBase(
typeof window === 'undefined'
? (process.env.API_INTERNAL_URL || 'http://localhost:4000/api/v1')
: (process.env.NEXT_PUBLIC_API_URL || '/dashboard/api/v1')
: (process.env.NEXT_PUBLIC_API_URL || '/dashboard/api/v1'),
)
export const EMPLOYEE_PROFILE_KEY = 'employee_profile'