| 1 | import fetch from 'unfetch'; |
| 2 | |
| 3 | const 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 | |
| 13 | export const getAllStudents = () => |
| 14 | fetch("api/v1/students") |
nothing calls this directly
no outgoing calls
no test coverage detected