Skip to content

Commit 4d8e21b

Browse files
authored
Merge pull request #8 from topcoder-platform/dev
Fix topic fetching
2 parents 19aa9ee + 735efe2 commit 4d8e21b

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

connect/service.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -105,14 +105,7 @@ const getTopic = (topicId) => request
105105
throw new Error(`Failed to get topic details of topic id: ${topicId}`);
106106
}
107107

108-
const topic = _.get(res, 'body.result.content');
109-
110-
// this API gives an array instead of one topic
111-
if (topic.length < 1) {
112-
throw new Error(`Failed to get topic details of topic id: ${topicId}`);
113-
}
114-
115-
return topic[0];
108+
return _.get(res, 'body.result.content');
116109
}).catch((err) => {
117110
const errorDetails = _.get(err, 'response.body.result.content.message');
118111
throw new Error(

0 commit comments

Comments
 (0)