fixes double body read in trails recommend

This commit is contained in:
Christian Beutel
2025-02-11 19:09:00 +01:00
parent e25875b525
commit 32f334d15d

View File

@@ -43,12 +43,12 @@ export async function trails_recommend(size: number, f: (url: RequestInfo | URL,
}), { }), {
method: 'GET', method: 'GET',
}) })
const response: Trail[] = await r.json()
if (!r.ok) { if (!r.ok) {
const response = await r.json(); const response = await r.json();
throw new APIError(r.status, response.message, response.detail) throw new APIError(r.status, response.message, response.detail)
} }
const response: Trail[] = await r.json()
return response; return response;