diff options
Diffstat (limited to 'src/classes')
-rw-r--r-- | src/classes/brand.js | 8 | ||||
-rw-r--r-- | src/classes/item.js | 6 |
2 files changed, 13 insertions, 1 deletions
diff --git a/src/classes/brand.js b/src/classes/brand.js index 967f9a1..f396c6f 100644 --- a/src/classes/brand.js +++ b/src/classes/brand.js @@ -43,8 +43,14 @@ export const getAllBrands = (ok, fail) => { .catch(err => fail()) } +export const editBrand = (brand, ok, fail) => { + axios.put(`/brand/${brand.id}`, brand) + .then(res => ok()) + .catch(err => fail()) +} + export const saveBrand = (brand, ok, fail) => { axios.post("/brand/new", brand) .then(res => ok()) - .catch((err) => fail()) + .catch(err => fail()) } diff --git a/src/classes/item.js b/src/classes/item.js index 1c59992..bfd0b7b 100644 --- a/src/classes/item.js +++ b/src/classes/item.js @@ -65,3 +65,9 @@ export const getAllItems = (ok, fail) => { .then(res => ok(res.data)) .catch(err => fail()) } + +export const editItem = (item, ok, fail) => { + axios.put(`/item/${item.id}`, item) + .then(res => ok()) + .catch(err => fail()) +} |