From: Jérôme Benoit Date: Mon, 5 Sep 2022 08:56:29 +0000 (+0200) Subject: Remove uneeded intermediate variable X-Git-Tag: v1.1.71~5 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=d0b0b492fe5e360a6fee8e1029511a7c66e76c59;p=e-mobility-charging-stations-simulator.git Remove uneeded intermediate variable Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/ui-server/UIHttpServer.ts b/src/charging-station/ui-server/UIHttpServer.ts index 289eda84..ce52ed4b 100644 --- a/src/charging-station/ui-server/UIHttpServer.ts +++ b/src/charging-station/ui-server/UIHttpServer.ts @@ -49,10 +49,11 @@ export default class UIHttpServer extends AbstractUIServer { public sendResponse(response: ProtocolResponse): void { const [uuid, payload] = response; - const statusCode = this.responseStatusToStatusCode(payload.status); if (this.responseHandlers.has(uuid) === true) { const { res } = this.responseHandlers.get(uuid); - res.writeHead(statusCode, { 'Content-Type': 'application/json' }); + res.writeHead(this.responseStatusToStatusCode(payload.status), { + 'Content-Type': 'application/json', + }); res.write(JSON.stringify(payload)); res.end(); this.responseHandlers.delete(uuid);