From: Jérôme Benoit Date: Tue, 30 Jan 2024 20:25:46 +0000 (+0100) Subject: refactor: cleanup UI service response X-Git-Tag: v1.2.34~14 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=859099b6e7adaf9eeed2aa348921a23d7aa0bc7a;p=e-mobility-charging-stations-simulator.git refactor: cleanup UI service response Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/broadcast-channel/ChargingStationWorkerBroadcastChannel.ts b/src/charging-station/broadcast-channel/ChargingStationWorkerBroadcastChannel.ts index 89f828b5..10d0c75c 100644 --- a/src/charging-station/broadcast-channel/ChargingStationWorkerBroadcastChannel.ts +++ b/src/charging-station/broadcast-channel/ChargingStationWorkerBroadcastChannel.ts @@ -285,7 +285,6 @@ export class ChargingStationWorkerBroadcastChannel extends WorkerBroadcastChanne return } let responsePayload: BroadcastChannelResponsePayload | undefined - let commandResponse: CommandResponse | undefined this.commandHandler(command, requestPayload) .then(commandResponse => { if (commandResponse == null || isEmptyObject(commandResponse)) { @@ -311,12 +310,10 @@ export class ChargingStationWorkerBroadcastChannel extends WorkerBroadcastChanne status: ResponseStatus.FAILURE, command, requestPayload, - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - commandResponse: commandResponse!, errorMessage: (error as OCPPError).message, errorStack: (error as OCPPError).stack, errorDetails: (error as OCPPError).details - } + } satisfies BroadcastChannelResponsePayload }) .finally(() => { // eslint-disable-next-line @typescript-eslint/no-non-null-assertion