status: responsesStatus,
hashIdsSucceeded: this.responses
.get(uuid)
- ?.responses.map(({ status, hashId }) => {
+ ?.responses.filter(({ hashId }) => hashId !== undefined)
+ .map(({ status, hashId }) => {
if (status === ResponseStatus.SUCCESS) {
return hashId;
}
- })
- .filter((hashId) => hashId !== undefined),
+ }),
...(responsesStatus === ResponseStatus.FAILURE && {
hashIdsFailed: this.responses
.get(uuid)
- ?.responses.map(({ status, hashId }) => {
+ ?.responses.filter(({ hashId }) => hashId !== undefined)
+ .map(({ status, hashId }) => {
if (status === ResponseStatus.FAILURE) {
return hashId;
}
- })
- .filter((hashId) => hashId !== undefined),
+ }),
}),
...(responsesStatus === ResponseStatus.FAILURE && {
responsesFailed: this.responses
.get(uuid)
- ?.responses.map((response) => {
+ ?.responses.filter((response) => response !== undefined)
+ .map((response) => {
if (response.status === ResponseStatus.FAILURE) {
return response;
}
- })
- .filter((response) => response !== undefined),
+ }),
}),
};
}
): void {
if (Utils.isNotEmptyArray(payload.hashIds)) {
payload.hashIds = payload.hashIds
+ .filter((hashId) => hashId !== undefined)
.map((hashId) => {
if (this.uiServer.chargingStations.has(hashId) === true) {
return hashId;
'sendBroadcastChannelRequest'
)} Charging station with hashId '${hashId}' not found`
);
- })
- .filter((hashId) => hashId !== undefined);
+ });
}
const expectedNumberOfResponses = Utils.isNotEmptyArray(payload.hashIds)
? payload.hashIds.length