From 2ea8735dffc06e2aa7442971134d2c0cd3100872 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Fri, 22 Mar 2024 09:58:26 +0100 Subject: [PATCH] fix: ensure add charging stations reponse display only the necessary fields MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- .../ui-server/ui-services/AbstractUIService.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/charging-station/ui-server/ui-services/AbstractUIService.ts b/src/charging-station/ui-server/ui-services/AbstractUIService.ts index 3fa3f8ba..6ba08807 100644 --- a/src/charging-station/ui-server/ui-services/AbstractUIService.ts +++ b/src/charging-station/ui-server/ui-services/AbstractUIService.ts @@ -302,7 +302,9 @@ export abstract class AbstractUIService { } return { status: failedStationInfos.length > 0 ? ResponseStatus.FAILURE : ResponseStatus.SUCCESS, - hashIdsSucceeded: succeededStationInfos.map(stationInfo => stationInfo.hashId), + ...(succeededStationInfos.length > 0 && { + hashIdsSucceeded: succeededStationInfos.map(stationInfo => stationInfo.hashId) + }), ...(failedStationInfos.length > 0 && { hashIdsFailed: failedStationInfos.map(stationInfo => stationInfo.hashId) }), -- 2.34.1