diff options
Diffstat (limited to 'src/classes')
-rw-r--r-- | src/classes/brand.js | 12 | ||||
-rw-r--r-- | src/classes/item.js | 2 |
2 files changed, 10 insertions, 4 deletions
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()) +} diff --git a/src/classes/item.js b/src/classes/item.js index 3985e9d..1c59992 100644 --- a/src/classes/item.js +++ b/src/classes/item.js @@ -50,7 +50,7 @@ export class InvoiceItem extends Item { export const saveItem = (item, ok, fail) => { axios.post("/item/new", item) - .then(res => { console.log(res);ok()}) + .then(res => ok()) .catch((err) => fail()) } |