File tree Expand file tree Collapse file tree
services/concept_insights Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ module.exports = function (RED) {
2020
2121 var username , password ;
2222 var service = cfenv . getAppEnv ( ) . getServiceCreds ( / c o n c e p t i n s i g h t s / 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 }
You can’t perform that action at this time.
0 commit comments