feat(users): integrate user info and services APIs into 3-tab detail panel with proper padding
This commit is contained in:
@@ -119,6 +119,12 @@ export async function request<T>(path: string, options: RequestOptions = {}): Pr
|
||||
return (await res.json()) as T
|
||||
}
|
||||
|
||||
export async function requestText(path: string, signal?: AbortSignal): Promise<string> {
|
||||
const res = await rawRequest(path, { signal })
|
||||
if (!res.ok) throw await parseError(res)
|
||||
return res.text()
|
||||
}
|
||||
|
||||
export const api = {
|
||||
get: <T>(path: string, params?: ListParams, signal?: AbortSignal) =>
|
||||
request<T>(path, { params, signal }),
|
||||
@@ -128,4 +134,5 @@ export const api = {
|
||||
delete: <T>(path: string, body?: unknown) => request<T>(path, { method: 'DELETE', body }),
|
||||
anonymousPost: <T>(path: string, body?: unknown) =>
|
||||
request<T>(path, { method: 'POST', body, anonymous: true }),
|
||||
text: (path: string, signal?: AbortSignal) => requestText(path, signal),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user