Skip to content

Commit

Permalink
Merge pull request #113 from wwoo/master
Browse files Browse the repository at this point in the history
Fix ignored approvalType argument for createproduct command
  • Loading branch information
msadasivam authored Apr 4, 2018
2 parents c20f80e + 512c43c commit 4dd460e
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions lib/commands/createproduct.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ var options = require('../options');

var descriptor = defaults.defaultDescriptor({
'productName': {
name: 'Product Name',
name: 'Product Name',
required: true
},
'productDesc': {
name: 'Description'
},
'proxies': {
name: 'API Proxies',
name: 'API Proxies',
required: true
},
'environments':{
Expand All @@ -28,7 +28,7 @@ var descriptor = defaults.defaultDescriptor({
required: true
},
'quota' : {
name: 'Quota',
name: 'Quota',
},
'quotaInterval':{
name: 'Quota Interval'
Expand All @@ -37,7 +37,7 @@ var descriptor = defaults.defaultDescriptor({
name:'Quota Time Unit'
},
'scopes': {
name: "Scope",
name: "Scope",
}
});

Expand All @@ -61,17 +61,20 @@ module.exports.run = function(opts, cb) {
});
};

function createProduct(opts,request,done){
function createProduct(opts,request,done){
var product = {
"approvalType": "auto",
"approvalType": "auto",
"attributes":
[ {"name": "access", "value": "public"} ],
[ {"name": "access", "value": "public"} ],
"scopes": []
}

product.name = opts.productName
product.displayName = opts.productName
product.description = opts.productDesc
if(opts.approvalType){
product.approvalType = opts.approvalType
}
product.proxies = []
if(opts.proxies){
var split = opts.proxies.split(',')
Expand All @@ -98,7 +101,7 @@ function createProduct(opts,request,done){
}
})
}
product.environments = []
product.environments = []
if(opts.environments){
var split = opts.environments.split(',')
split.forEach(function(s){
Expand Down Expand Up @@ -148,4 +151,3 @@ function createProduct(opts,request,done){
}
})
}

0 comments on commit 4dd460e

Please sign in to comment.