May 2018
Intermediate to advanced
470 pages
13h 54m
English
We will add a corresponding method in the frontend to make a delete request to the delete API.
mern-marketplace/client/shop/api-shop.js:
const remove = (params, credentials) => { return fetch('/api/shops/' + params.shopId, { method: 'DELETE', headers: { 'Accept': 'application/json', 'Content-Type': 'application/json', 'Authorization': 'Bearer ' + credentials.t } }).then((response) => { return response.json() }).catch((err) => { console.log(err) })}
Read now
Unlock full access