aboutsummaryrefslogtreecommitdiff
path: root/src/classes
diff options
context:
space:
mode:
authorVidhu Kant Sharma <vidhukant@vidhukant.xyz>2022-09-27 17:34:12 +0530
committerVidhu Kant Sharma <vidhukant@vidhukant.xyz>2022-09-27 17:34:12 +0530
commit072e53f0b2eb8fa14c0aa49286193784c73257cb (patch)
treeeaf151ed3c248a5af730cbf5c0b950794ccace1f /src/classes
parent24bb92944849ac2ddf2f777d52c23a150eedffe8 (diff)
added a brands management page
Diffstat (limited to 'src/classes')
-rw-r--r--src/classes/brand.js12
-rw-r--r--src/classes/item.js2
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())
}