Skip to content

Commit 28f7ead

Browse files
committed
fix bug with upload document
1 parent d970d5c commit 28f7ead

2 files changed

Lines changed: 10 additions & 8 deletions

File tree

services/concept_insights/v2.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@
139139
color: "rgb(85, 150, 230)",
140140
inputs: 1,
141141
outputs: 0,
142-
icon: "ConceptInsights.png",
142+
icon: "concept_insights.png",
143143
paletteLabel: "concept insights upload document",
144144
label: function() {
145145
return this.name || "concept insights upload document";
@@ -259,7 +259,7 @@
259259
color: "rgb(85, 150, 230)",
260260
inputs: 1,
261261
outputs: 1,
262-
icon: "ConceptInsights.png",
262+
icon: "concept_insights.png",
263263
paletteLabel: "concept insights search",
264264
label: function() {
265265
return this.name || "concept insights search";
@@ -342,7 +342,7 @@
342342
color: "rgb(85, 150, 230)",
343343
inputs: 1,
344344
outputs: 1,
345-
icon: "ConceptInsights.png",
345+
icon: "concept_insights.png",
346346
paletteLabel: "concept insights search concepts",
347347
label: function() {
348348
return this.name || "concept insights search concepts";
@@ -402,7 +402,7 @@
402402
color: "rgb(85, 150, 230)",
403403
inputs: 1,
404404
outputs: 1,
405-
icon: "ConceptInsights.png",
405+
icon: "concept_insights.png",
406406
paletteLabel: "concept insights related concepts",
407407
label: function() {
408408
return this.name || "concept insights related concepts";

services/concept_insights/v2.js

Lines changed: 6 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-
console.log(cfenv).getAppEnv().getServices();
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,14 @@ 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) {
402+
console.log(err);
400403
var message = err.error;
401404
return node.error(message, msg);
402405
} else {
403-
node.status({});
404406
var account_id = res.accounts[0].account_id;
405407
if (callback) callback(concept_insights,account_id);
406408
}

0 commit comments

Comments
 (0)