Compare View

switch
from
...
to
 
Commits (4)

Changes

Showing 3 changed files 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.trim()) {
25 25 res.json({
26 26 method: '/products/add',
27 27 error: true,
... ... @@ -31,7 +31,8 @@ function pageAdd(req, res, next) {
31 31 return;
32 32 }
33 33  
34   - config.products.push(newProduct.trim().toUpperCase());
  34 + const product = req.params.product.trim().toUpperCase();
  35 + config.products.push(product);
35 36 config.products.map(function(x) { return x.toUpperCase(); });
36 37 unique(config.products);
37 38 config.products.sort(naturalSort());
... ... @@ -40,13 +41,13 @@ function pageAdd(req, res, next) {
40 41 res.json({
41 42 method: '/products/add',
42 43 error: null,
43   - new_product: newProduct,
  44 + new_product: product,
44 45 products: config.products
45 46 })
46 47 }
47 48  
48 49 function pageDel(req, res, next) {
49   - if (!req.params.product || req.params.product !== 'string' || !req.params.product.trim()) {
  50 + if (!req.params.product || !req.params.product.trim()) {
50 51 res.json({
51 52 method: '/products/del',
52 53 error: true,
1 1 {
2 2 "name": "komodo-sdk",
3   - "version": "1.29.1",
  3 + "version": "1.29.2",
4 4 "lockfileVersion": 1,
5 5 "requires": true,
6 6 "dependencies": {
1 1 {
2 2 "name": "komodo-sdk",
3   - "version": "1.29.1",
  3 + "version": "1.29.2",
4 4 "description": "SDK for Komodo",
5 5 "main": "index.js",
6 6 "scripts": {