3 lines
176 B
JavaScript
3 lines
176 B
JavaScript
export default function handleFetchResponse(response) {
|
|
return response.status === 200 ? Promise.resolve(response.json()) : Promise.reject(new Error(response.statusText));
|
|
}
|