From 79baf639b33a50ca0fcb9f85186f5f500fb0bf54 Mon Sep 17 00:00:00 2001 From: Thomas Kranitsas Date: Thu, 9 Dec 2021 19:00:21 +0200 Subject: [PATCH] read from array instead of object --- src/common/helper.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/common/helper.js b/src/common/helper.js index f0cee0cc..2a70c367 100644 --- a/src/common/helper.js +++ b/src/common/helper.js @@ -1000,7 +1000,8 @@ async function getMemberById (userId) { const res = await axios.get(`${config.MEMBERS_API_URL}?userId=${userId}`, { headers: { Authorization: `Bearer ${token}` } }) - return res.data || {} + if (res.data.length > 0) return res.data[0] + return {} } module.exports = {