From 072e53f0b2eb8fa14c0aa49286193784c73257cb Mon Sep 17 00:00:00 2001 From: Vidhu Kant Sharma Date: Tue, 27 Sep 2022 17:34:12 +0530 Subject: added a brands management page --- src/classes/brand.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/classes/brand.js') diff --git a/src/classes/brand.js b/src/classes/brand.js index 48bc974..967f9a1 100644 --- a/src/classes/brand.js +++ b/src/classes/brand.js @@ -32,9 +32,9 @@ export class Brand { } export const deleteBrand = (id, ok, fail) => { - axios.delete(`/brand/${id}`) - .then(res => ok()) - .catch(err => fail()) + axios.delete(`/brand/${id}`) + .then(res => ok()) + .catch(err => fail()) } export const getAllBrands = (ok, fail) => { @@ -42,3 +42,9 @@ export const getAllBrands = (ok, fail) => { .then(res => ok(res.data)) .catch(err => fail()) } + +export const saveBrand = (brand, ok, fail) => { + axios.post("/brand/new", brand) + .then(res => ok()) + .catch((err) => fail()) +} -- cgit v1.2.3