diff --git a/UI/assets/js/products.js b/UI/assets/js/products.js index 61f48b3..149bb21 100644 --- a/UI/assets/js/products.js +++ b/UI/assets/js/products.js @@ -1,15 +1,32 @@ -getProducts = () => { - const options = { - headers: new Headers({ +const getProducts = () => { + fetch('https://newstoremanager.herokuapp.com/api/v1/products', { + headers: { 'Content-Type': 'application/json', - 'accessstoken': localStorage.accesstoken, - }), - }; - fetch('https://newstoremanager.herokuapp.com/api/v1/products', options) + accesstoken: localStorage.accesstoken, + }, + }) .then(res => res.json()) .then((data) => { - let output = '
${user.productname}
+${user.price}
+ + +