fix: ensure proper status in add charging stations op response
authorJérôme Benoit <jerome.benoit@sap.com>
Fri, 22 Mar 2024 17:52:54 +0000 (18:52 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Fri, 22 Mar 2024 17:52:54 +0000 (18:52 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/ui-server/ui-services/AbstractUIService.ts

index 6ba08807b3afcecc895428cab5911797f9cbf718..ffdc256583adccd581d72c99496e3bfe726333e2 100644 (file)
@@ -301,7 +301,7 @@ export abstract class AbstractUIService {
       }
     }
     return {
-      status: failedStationInfos.length > 0 ? ResponseStatus.FAILURE : ResponseStatus.SUCCESS,
+      status: err != null ? ResponseStatus.FAILURE : ResponseStatus.SUCCESS,
       ...(succeededStationInfos.length > 0 && {
         hashIdsSucceeded: succeededStationInfos.map(stationInfo => stationInfo.hashId)
       }),