diff --git a/frontend/src/api/client.ts b/frontend/src/api/client.ts index 96104a9..ccbd951 100644 --- a/frontend/src/api/client.ts +++ b/frontend/src/api/client.ts @@ -1,7 +1,14 @@ const BASE = '/api'; +function withDevUser(path: string): string { + const devUser = new URLSearchParams(window.location.search).get('devUser'); + if (!devUser) return path; + const sep = path.includes('?') ? '&' : '?'; + return `${path}${sep}devUser=${devUser}`; +} + async function request(path: string, options?: RequestInit): Promise { - const res = await fetch(`${BASE}${path}`, { + const res = await fetch(`${BASE}${withDevUser(path)}`, { ...options, headers: { 'Content-Type': 'application/json',