From 735efe2a028c686c6c28f468b17b3d4c5d8a2972 Mon Sep 17 00:00:00 2001 From: gondzo Date: Thu, 4 Jan 2018 00:25:50 +0100 Subject: [PATCH] Update service.js --- connect/service.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/connect/service.js b/connect/service.js index bf0cea7..cfe7fb5 100644 --- a/connect/service.js +++ b/connect/service.js @@ -105,14 +105,7 @@ const getTopic = (topicId) => request throw new Error(`Failed to get topic details of topic id: ${topicId}`); } - const topic = _.get(res, 'body.result.content'); - - // this API gives an array instead of one topic - if (topic.length < 1) { - throw new Error(`Failed to get topic details of topic id: ${topicId}`); - } - - return topic[0]; + return _.get(res, 'body.result.content'); }).catch((err) => { const errorDetails = _.get(err, 'response.body.result.content.message'); throw new Error(