fix: ensure proper status in add charging stations op response
[e-mobility-charging-stations-simulator.git] / 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)
       }),