Fetch the shop in the view

In api-shop.js, we will add a fetch method to use this read API in the frontend.

mern-marketplace/client/shop/api-shop.js:

const read = (params, credentials) => {  return fetch('/api/shop/' + params.shopId, {    method: 'GET'  }).then((response) => {    return response.json()  }).catch((err)  => console.log(err) )}

Get Full-Stack React Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.