Skip to content

Commit

Permalink
found another place where the legacy/rocket.chat service is called
Browse files Browse the repository at this point in the history
  • Loading branch information
ja-fra committed Feb 15, 2018
1 parent 38dd8ac commit 4cc03fe
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/assistify-ai/server/SmartiProxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export class SmartiProxy {
}
}

SystemLogger.error('Could not complete', method, 'to', url);
SystemLogger.error('Could not complete', method, 'to', url, error.response);
SystemLogger.debug(error);
}
}
Expand Down
3 changes: 1 addition & 2 deletions packages/assistify-ai/server/lib/SmartiAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ export class SmartiAdapter {
} else {
SystemLogger.debug('Smarti - Trying legacy service to retrieve conversation ID...');
const conversation = SmartiProxy.propagateToSmarti(verbs.get,
`legacy/rocket.chat?channel_id=${ message.rid }`, null,
function (error) {
`legacy/rocket.chat?channel_id=${ message.rid }`, null, (error) => {
// 404 is expected if no mapping exists
if (error.response.statusCode === 404) {
return null;
Expand Down
7 changes: 6 additions & 1 deletion packages/assistify-ai/server/methods/SmartiWidgetBackend.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,12 @@ Meteor.methods({
return !RocketChat.authz.hasPermission(userId, 'send-many-messages');
}
}
)(verbs.get, `legacy/rocket.chat?channel_id=${ channelId }`);
)(verbs.get, `legacy/rocket.chat?channel_id=${ channelId }`, null, (error) => {
// 404 is expected if no mapping exists
if (error.response.statusCode === 404) {
return null;
}
});

if (conversation && conversation.id) {
let timestamp = conversation.messages &&
Expand Down

0 comments on commit 4cc03fe

Please sign in to comment.