fixes double body read in trails recommend
This commit is contained in:
@@ -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;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user