Skip to content

Commit 472721b

Browse files
Merge pull request #439 from topcoder-platform/aggregate-mm-data
read from array instead of object
2 parents 5a1dd4e + 79baf63 commit 472721b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/common/helper.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1000,7 +1000,8 @@ async function getMemberById (userId) {
10001000
const res = await axios.get(`${config.MEMBERS_API_URL}?userId=${userId}`, {
10011001
headers: { Authorization: `Bearer ${token}` }
10021002
})
1003-
return res.data || {}
1003+
if (res.data.length > 0) return res.data[0]
1004+
return {}
10041005
}
10051006

10061007
module.exports = {

0 commit comments

Comments
 (0)