diff --git a/src/api.js b/src/api.js index 414490c..0d1601e 100644 --- a/src/api.js +++ b/src/api.js @@ -60,6 +60,13 @@ export const getProducts = async () => { return response.data; }; +export const modifyProduct = async (productData, id) => { + const response = await api.patch(`/products/${id}/`, productData, { + headers: {Authorization: `Bearer ${sessionStorage.getItem('access_token')}`}, +}); +return response.data; +}; + const refreshAccessToken = async () => { try { const response = await api.post('/token/refresh', {'refresh': Cookies.get('refresh')}, { diff --git a/src/views/Home.vue b/src/views/Home.vue index 21259e6..baf186d 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -1,5 +1,5 @@ + Tableau de bord Créer un produit @@ -118,19 +147,34 @@ try { Nom : - + - + {{ registerErrors.name }} - + Description : - + - + {{ registerErrors.description }} @@ -138,59 +182,123 @@ try { Quantité : - + - + {{ registerErrors.quantity }} - Activer une alerte ? - + + Activer une alerte ? + + + - + {{ registerErrors.alert_enabled }} - + {{ registerErrors.stock_limit }} - + + - + - + - + + - + - - - + + + + - - - + + + + - + + - + - - + + - - + + + + - \ No newline at end of file