aboutsummaryrefslogtreecommitdiff
path: root/src/classes/item.js
diff options
context:
space:
mode:
authorVidhu Kant Sharma <vidhukant@vidhukant.xyz>2022-09-27 23:21:31 +0530
committerVidhu Kant Sharma <vidhukant@vidhukant.xyz>2022-09-27 23:21:31 +0530
commite4dbf70d561aa3ed79379ffdb98661cb3f215fe9 (patch)
treec11a45544c5c39c5d7236019c89a76c1ca850ae0 /src/classes/item.js
parent39819430fa47172c1a3a36218339f6baf86f8983 (diff)
Bug Fix: undefined sent as ID when updating a brand/item
Diffstat (limited to 'src/classes/item.js')
-rw-r--r--src/classes/item.js9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/classes/item.js b/src/classes/item.js
index bfd0b7b..0486262 100644
--- a/src/classes/item.js
+++ b/src/classes/item.js
@@ -18,13 +18,6 @@
import axios from "axios";
import { Brand } from "./brand"
-/* TODO: implement a better way to handle
- * API responses/errors
- *
- * maybe I can send a notification when an item
- * is successfully added, or when some error occours
- */
-
export class Item {
constructor() {
this.Id = null;
@@ -67,7 +60,7 @@ export const getAllItems = (ok, fail) => {
}
export const editItem = (item, ok, fail) => {
- axios.put(`/item/${item.id}`, item)
+ axios.put(`/item/${item.Id}`, item)
.then(res => ok())
.catch(err => fail())
}