Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ignored approvalType argument for createproduct command #113

Merged
merged 1 commit into from
Apr 4, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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){
}
})
}