Commit 2678d5d308f1548af6c1b7a2b36c69b8b367e7ff
1 parent
eeeecf6941
Exists in
master
debug
Showing 1 changed file with 2 additions and 2 deletions Side-by-side Diff
api-server/router-products.js
... | ... | @@ -21,7 +21,7 @@ function pageIndex(req, res, next) { |
21 | 21 | |
22 | 22 | function pageAdd(req, res, next) { |
23 | 23 | //if (!req.params.product || req.params.product !== 'string' || !req.params.product.trim()) { |
24 | - if (!req.params.product) { | |
24 | + if (!req.params.product || req.params.product !== 'string') { | |
25 | 25 | res.json({ |
26 | 26 | method: '/products/add', |
27 | 27 | error: true, |
... | ... | @@ -31,7 +31,7 @@ function pageAdd(req, res, next) { |
31 | 31 | return; |
32 | 32 | } |
33 | 33 | |
34 | - config.products.push(newProduct.trim().toUpperCase()); | |
34 | + config.products.push(req.params.product.trim().toUpperCase()); | |
35 | 35 | config.products.map(function(x) { return x.toUpperCase(); }); |
36 | 36 | unique(config.products); |
37 | 37 | config.products.sort(naturalSort()); |