fix: Creators page 422 — limit=200 exceeded API max of 100, also fix error display for Pydantic validation arrays

This commit is contained in:
jlightner 2026-03-30 02:37:37 -05:00
parent ac45ce7313
commit e08e8d021f
2 changed files with 3 additions and 2 deletions

View file

@ -176,7 +176,8 @@ async function request<T>(url: string, init?: RequestInit): Promise<T> {
try { try {
const body: unknown = await res.json(); const body: unknown = await res.json();
if (typeof body === "object" && body !== null && "detail" in body) { if (typeof body === "object" && body !== null && "detail" in body) {
detail = String((body as { detail: unknown }).detail); const d = (body as { detail: unknown }).detail;
detail = typeof d === "string" ? d : Array.isArray(d) ? d.map((e: any) => e.msg || JSON.stringify(e)).join("; ") : JSON.stringify(d);
} }
} catch { } catch {
// body not JSON — keep statusText // body not JSON — keep statusText

View file

@ -57,7 +57,7 @@ export default function CreatorsBrowse() {
const res = await fetchCreators({ const res = await fetchCreators({
sort, sort,
genre: genreFilter ?? undefined, genre: genreFilter ?? undefined,
limit: 200, limit: 100,
}); });
if (!cancelled) setCreators(res.items); if (!cancelled) setCreators(res.items);
} catch (err) { } catch (err) {