Orgs, Members, SSH and Admin page

This commit is contained in:
allanice001
2025-09-01 21:58:34 +01:00
parent 3f22521f49
commit 5425ed5dcc
61 changed files with 7138 additions and 819 deletions

View File

@@ -37,6 +37,11 @@ function authHeaders(): Record<string, string> {
return headers
}
function orgContextHeaders(): Record<string, string> {
const id = localStorage.getItem("active_org_id")
return id ? { "X-Org-ID": id } : {}
}
async function request<T>(
path: string,
method: Method,
@@ -50,6 +55,7 @@ async function request<T>(
const merged: Record<string, string> = {
...baseHeaders,
...(opts.auth === false ? {} : authHeaders()),
...orgContextHeaders(),
...normalizeHeaders(opts.headers),
}
@@ -83,6 +89,8 @@ async function request<T>(
throw new ApiError(res.status, String(msg), payload)
}
console.debug("API ->", method, `${API_BASE_URL}${path}`, merged)
return isJSON ? (payload as T) : (undefined as T)
}