Skip to content

Commit abb5f7a

Browse files
committed
Merge pull request #49 from DanCunnington/master
Bug fix concept insights upload document
2 parents fd4d5c4 + 3e03656 commit abb5f7a

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

  • services/concept_insights

services/concept_insights/v2.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ module.exports = function (RED) {
2020

2121
var username, password;
2222
var service = cfenv.getAppEnv().getServiceCreds(/concept insights/i);
23-
23+
2424
if (service) {
2525
username = service.username;
2626
password = service.password;
@@ -259,7 +259,8 @@ module.exports = function (RED) {
259259
var corpus_name = this.corpus.cname;
260260
var access = this.corpus.access;
261261

262-
if (this.corpus.publiccorpus) {
262+
//Private corpus takes precedence, but change to public if there is one.
263+
if (this.corpus.publiccorpus && !this.corpus.cname) {
263264
corpus_name = this.corpus.publiccorpus;
264265
account_id = 'public';
265266
}
@@ -394,13 +395,13 @@ module.exports = function (RED) {
394395
version: 'v2'
395396
});
396397

398+
node.status({fill:"blue",shape:"ring",text:"Getting account information"});
397399
concept_insights.accounts.getAccountsInfo({},function(err,res) {
398-
node.status({fill:"blue",shape:"ring",text:"Getting account information"});
400+
node.status({});
399401
if (err) {
400402
var message = err.error;
401403
return node.error(message, msg);
402404
} else {
403-
node.status({});
404405
var account_id = res.accounts[0].account_id;
405406
if (callback) callback(concept_insights,account_id);
406407
}

0 commit comments

Comments
 (0)