Remove uneeded intermediate variable
authorJérôme Benoit <jerome.benoit@sap.com>
Mon, 5 Sep 2022 08:56:29 +0000 (10:56 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Mon, 5 Sep 2022 08:56:29 +0000 (10:56 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/ui-server/UIHttpServer.ts

index 289eda84781ad0d7686e88846a95e028cf45921f..ce52ed4b5dd432a9c9035bbdc0eac01c7a422e4f 100644 (file)
@@ -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);