From ef4a3299ed2c21d45672a7c4631b1adb1a0ea2a7 Mon Sep 17 00:00:00 2001 From: Stoyan Zhekov Date: Sun, 16 May 2021 11:16:59 +0900 Subject: [PATCH] Fix error response format --- src/routes/v4/slp.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/routes/v4/slp.js b/src/routes/v4/slp.js index 1538e98..6509118 100644 --- a/src/routes/v4/slp.js +++ b/src/routes/v4/slp.js @@ -2284,7 +2284,8 @@ class Slp { const childrenRes = await _this.axios.request(opt) // console.log(`childrenRes.data: ${JSON.stringify(childrenRes.data, null, 2)}`) if (!childrenRes || !childrenRes.data || !childrenRes.data.t) { - return { error: 'No children data in the group' } + res.status(400) + return res.json({ error: 'No children data in the group' }) } childrenRes.data.t.forEach(function (token) {