fix(web): fix personalities page dark mode theming and wire to API (#540)
Some checks failed
ci/woodpecker/push/web Pipeline failed
Some checks failed
ci/woodpecker/push/web Pipeline failed
Co-authored-by: Jason Woltje <jason@diversecanvas.com> Co-committed-by: Jason Woltje <jason@diversecanvas.com>
This commit was merged in pull request #540.
This commit is contained in:
@@ -250,6 +250,11 @@ export async function apiRequest<T>(endpoint: string, options: ApiRequestOptions
|
||||
throw new Error(error.message);
|
||||
}
|
||||
|
||||
// 204 No Content responses have no body — return undefined cast to T
|
||||
if (response.status === 204) {
|
||||
return undefined as T;
|
||||
}
|
||||
|
||||
return await (response.json() as Promise<T>);
|
||||
} catch (err: unknown) {
|
||||
if (err instanceof DOMException && err.name === "AbortError") {
|
||||
|
||||
Reference in New Issue
Block a user