From 619ae1b940e62ab908aa2547a949311233030ec7 Mon Sep 17 00:00:00 2001 From: Chad Derya Date: Mon, 9 Sep 2019 20:11:18 +0100 Subject: [PATCH] Delete only the selected fuel, but lets not play with fire at this time of the night, and accidentally delete all fuels Test in the morning --- src/api/product.js | 10 ++++ src/views/products/components/EditorImage.vue | 55 +++++-------------- 2 files changed, 24 insertions(+), 41 deletions(-) diff --git a/src/api/product.js b/src/api/product.js index f8ba8dde..a9ebba80 100644 --- a/src/api/product.js +++ b/src/api/product.js @@ -21,6 +21,16 @@ export function updateProduct(data) { return axios.put(`${ProductEndpointUrl}/fuels/${data._id}`, dto) } +export function deleteProduct(data) { + if (data !== '') { + console.log(data) + const chad = `${ProductEndpointUrl}/fuels/${data}?secret=MySecretForFuels&platform=${store.state.platform}` + // return axios.delete(${ProductEndpointUrl}/fuels/${data}?secret=MySecretForFuels&platform=${store.state.platform}) + return chad + } + return 'error' +} + function __dataToDTO(data) { return { 'name': data.name, diff --git a/src/views/products/components/EditorImage.vue b/src/views/products/components/EditorImage.vue index 9d46ff82..919a5d1d 100644 --- a/src/views/products/components/EditorImage.vue +++ b/src/views/products/components/EditorImage.vue @@ -28,16 +28,23 @@

SUCCESS you can now close this popup

{{ item._id }}

+ + Close +

ERROR please try again, if the error persist contact Chadmin!

+ + Close +