- logger.warn(
- `${this.logPrefix(
- moduleName,
- 'sendBroadcastChannelRequest',
- )} Charging station with hashId '${hashId}' not found`,
- );
- }) as string[];
+ const msg = `${this.logPrefix(
+ moduleName,
+ 'sendBroadcastChannelRequest',
+ )} Charging station with hashId '${hashId}' not found`;
+ if (payload.hashIds?.length === 1) {
+ throw new BaseError(msg);
+ } else {
+ logger.warn(msg);
+ }
+ })
+ ?.filter((hashId) => !isNullOrUndefined(hashId)) as string[];