MCPcopy Create free account
hub / github.com/amigoscode/spring-boot-fullstack-professional / checkStatus

Function checkStatus

src/frontend/src/client.js:3–11  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1import fetch from 'unfetch';
2
3const checkStatus = response => {
4 if (response.ok) {
5 return response;
6 }
7 // convert non-2xx HTTP responses into errors:
8 const error = new Error(response.statusText);
9 error.response = response;
10 return Promise.reject(error);
11}
12
13export const getAllStudents = () =>
14 fetch("api/v1/students")

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected