Skip to content

Commit

Permalink
Fixed issue with scanning barcode
Browse files Browse the repository at this point in the history
  • Loading branch information
drkNsubuga committed Jan 13, 2023
1 parent 419cf9b commit 2548796
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
12 changes: 6 additions & 6 deletions api/inventory.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,20 +130,20 @@ app.delete("/product/:productId", function (req, res) {
inventoryDB.remove({
_id: parseInt(req.params.productId)
}, function (err, numRemoved) {
if (err) res.status(500).send(err);
if (err) res.sendStatus(500).send(err);
else res.sendStatus(200);
});
});



app.post("/product/sku", function (req, res) {
var request = req.body;
let sku = req.body.skuCode;
inventoryDB.findOne({
barcode: parseInt(request.skuCode),
_id: parseInt(request.skuCode)
}, function (err, product) {
res.send(product);
barcode: parseInt(sku)
}, function (err, doc) {
if (err) res.sendStatus(500).send(err);
else res.send(doc);
});
});

Expand Down
1 change: 0 additions & 1 deletion assets/css/pages.css
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ margin-right: 30px;
border-bottom: 1px solid #f1f1f1;
}
#login,
#searchBarCode,
#paymentModel,
#newCustomer,
#newProduct,
Expand Down

0 comments on commit 2548796

Please sign in to comment.