From b029e74e2da1c9181d29ec10e6e2f4c2375b8da9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Mon, 5 Jun 2023 21:14:57 +0200 Subject: [PATCH] refactor: cleanup reservation code MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/charging-station/ChargingStation.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/charging-station/ChargingStation.ts b/src/charging-station/ChargingStation.ts index 24f94682..0101e26e 100644 --- a/src/charging-station/ChargingStation.ts +++ b/src/charging-station/ChargingStation.ts @@ -935,8 +935,7 @@ export class ChargingStation { if (exists) { await this.removeReservation(reservationFound); } - const connectorStatus = this.getConnectorStatus(reservation.connectorId); - connectorStatus.reservation = reservation; + this.getConnectorStatus(reservation.connectorId).reservation = reservation; await OCPPServiceUtils.sendAndSetConnectorStatus( this, reservation.connectorId, @@ -968,6 +967,8 @@ export class ChargingStation { ); delete connector.reservation; break; + default: + break; } } -- 2.34.1