From 19e09ace3549dd70eac2ab589ef8991061d2e5cd Mon Sep 17 00:00:00 2001 From: Marcus Kimpenhaus Date: Mon, 26 Dec 2022 02:30:14 +0100 Subject: [PATCH] eslint fixes --- src/widgets/xteve/proxy.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/widgets/xteve/proxy.js b/src/widgets/xteve/proxy.js index fdf15272..dada6734 100644 --- a/src/widgets/xteve/proxy.js +++ b/src/widgets/xteve/proxy.js @@ -21,7 +21,7 @@ export default async function xteveProxyHandler(req, res) { const url = formatApiCall(api, { endpoint, ...widget }); const method = "POST"; - let payload = { "cmd": "status" }; + const payload = { "cmd": "status" }; if (widget.username && widget.password) { const body = JSON.stringify({ @@ -30,7 +30,7 @@ export default async function xteveProxyHandler(req, res) { "password": widget.password, }); - let [status, contentType, data] = await httpProxy(url, { + const [status, contentType, data] = await httpProxy(url, { method, body, }); @@ -42,16 +42,16 @@ export default async function xteveProxyHandler(req, res) { const json = JSON.parse(data.toString()); if (json?.status !== true) { - let message = "Authentication failed."; - return res.status(401).end(JSON.stringify({error: { message: message } })); + const message = "Authentication failed."; + return res.status(401).end(JSON.stringify({error: { message } })); } - payload["token"] = json.token; + payload.token = json.token; } const body = JSON.stringify(payload); - let [status, contentType, data] = await httpProxy(url, { + const [status, contentType, data] = await httpProxy(url, { method, body, });