Commit 438d7f4c16caef59e59cfa03dff7de6ee888b022
1 parent
2678d5d308
Exists in
master
simplifikasi products add/del
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 || req.params.product !== 'string') { | |
24 | + if (!req.params.product || !req.params.product.trim()) { | |
25 | 25 | res.json({ |
26 | 26 | method: '/products/add', |
27 | 27 | error: true, |
... | ... | @@ -46,7 +46,7 @@ function pageAdd(req, res, next) { |
46 | 46 | } |
47 | 47 | |
48 | 48 | function pageDel(req, res, next) { |
49 | - if (!req.params.product || req.params.product !== 'string' || !req.params.product.trim()) { | |
49 | + if (!req.params.product || !req.params.product.trim()) { | |
50 | 50 | res.json({ |
51 | 51 | method: '/products/del', |
52 | 52 | error: true, |