From e8a0d58675f346a6826cac9d1dd6e57487cf07bc Mon Sep 17 00:00:00 2001 From: rxdn <29165304+rxdn@users.noreply.github.com> Date: Fri, 5 Mar 2021 18:47:05 +0000 Subject: [PATCH] Fix some cases of [object Object] --- public/templates/views/panels.tmpl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/public/templates/views/panels.tmpl b/public/templates/views/panels.tmpl index 3444145..ffea617 100644 --- a/public/templates/views/panels.tmpl +++ b/public/templates/views/panels.tmpl @@ -444,11 +444,11 @@ async function fillPanels(channels) { const res = await axios.get('/api/{{.guildId}}/panels'); if (res.status !== 200) { - notifyError(res.data); + notifyError(res.data.error); return 0; } - for (const panel of res.data) { + for (const panel of res.data.error) { appendPanel(panel, channels); } @@ -461,7 +461,7 @@ async function fillMultiPanels() { const res = await axios.get('/api/{{.guildId}}/multipanels'); if (res.status !== 200) { - notifyError(res.data); + notifyError(res.data.error); return; } @@ -496,7 +496,7 @@ // roles const res = await axios.get('/api/{{.guildId}}/roles'); if (res.status !== 200 || !res.data.success) { - notifyError(res.data); + notifyError(res.data.error); return; } @@ -523,7 +523,7 @@ const res = await axios.get('/api/{{.guildId}}/team'); if (res.status !== 200) { - notifyError(res.data); + notifyError(res.data.error); return; }