Revert promise resolve/reject value
authorJérôme Benoit <jerome.benoit@sap.com>
Tue, 28 Sep 2021 21:28:09 +0000 (23:28 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Tue, 28 Sep 2021 21:28:09 +0000 (23:28 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
src/charging-station/ocpp/OCPPRequestService.ts

index 1bc8e70cd275cab6decf2049d12e6bfc9316eaef..a8567b4dad11771948b690b6bea6e823ca37a643 100644 (file)
@@ -56,7 +56,7 @@ export default abstract class OCPPRequestService {
       // Response?
       if (messageType !== MessageType.CALL_MESSAGE) {
         // Yes: send Ok
-        resolve({ commandName, commandParams });
+        resolve(commandParams);
       } else {
         // Send timeout
         setTimeout(() => rejectCallback(new OCPPError(ErrorType.GENERIC_ERROR, `Timeout for message id '${messageId}' with content '${messageToSend}'`, commandParams?.details ?? {})), Constants.OCPP_SOCKET_TIMEOUT);
@@ -75,7 +75,7 @@ export default abstract class OCPPRequestService {
         // Send the response
         await self.ocppResponseService.handleResponse(commandName as RequestCommand, payload, requestPayload);
         self.chargingStation.requests.delete(messageId);
-        resolve({ commandName, payload, requestPayload });
+        resolve(payload);
       }
 
       /**