May 2018
Intermediate to advanced
470 pages
13h 54m
English
The list method will use fetch to make a GET call to retrieve all the users in the database, and then return the response from the server as a promise to the component.
mern-skeleton/client/user/api-user.js:
const list = () => { return fetch('/api/users/', { method: 'GET', }).then(response => { return response.json() }).catch((err) => console.log(err))}
Read now
Unlock full access