refactor: cleanup variables namespace
authorJérôme Benoit <jerome.benoit@sap.com>
Fri, 9 Feb 2024 14:56:04 +0000 (15:56 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Fri, 9 Feb 2024 14:56:04 +0000 (15:56 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/ui-server/UIHttpServer.ts

index b10d33363b4ae9cc2898eae9eb5efd426b317613..eafea59ad3ec2398be9f1e4c2c526e829c7e98d2 100644 (file)
@@ -126,9 +126,9 @@ export class UIHttpServer extends AbstractUIServer {
             bodyBuffer.push(chunk)
           })
           .on('end', () => {
-            let body: RequestPayload | undefined
+            let requestPayload: RequestPayload | undefined
             try {
-              body = JSON.parse(Buffer.concat(bodyBuffer).toString()) as RequestPayload
+              requestPayload = JSON.parse(Buffer.concat(bodyBuffer).toString()) as RequestPayload
             } catch (error) {
               this.sendResponse(
                 this.buildProtocolResponse(uuid, {
@@ -141,7 +141,7 @@ export class UIHttpServer extends AbstractUIServer {
             }
             this.uiServices
               .get(version)
-              ?.requestHandler(this.buildProtocolRequest(uuid, procedureName, body))
+              ?.requestHandler(this.buildProtocolRequest(uuid, procedureName, requestPayload))
               .then((protocolResponse?: ProtocolResponse) => {
                 if (protocolResponse != null) {
                   this.sendResponse(protocolResponse)