refactor: code cleanup

This commit is contained in:
Sebastian Pravda 2022-12-23 16:30:44 +01:00
parent 7e3740f436
commit d224159372
No known key found for this signature in database
GPG key ID: F3BC84F08EFA3F57

View file

@ -26,7 +26,7 @@ export const apiFetchDetails = async (fetchSsr?: Fetch): Promise<CandidateData>
method: 'GET',
credentials: 'include'
});
if (res.status != 200) {
if (!res.ok) {
throw new Error(await res.text());
}
return await res.json();