diff --git a/libs/event-emitter/src/dashboards/dashboards-data.service.ts b/libs/event-emitter/src/dashboards/dashboards-data.service.ts index f240bd1..0ba0ddb 100644 --- a/libs/event-emitter/src/dashboards/dashboards-data.service.ts +++ b/libs/event-emitter/src/dashboards/dashboards-data.service.ts @@ -22,6 +22,7 @@ export class DashboardsDataService { const cfg = await this.dashboardsService.load(id); const results: WidgetWithData[] = []; let isSuccess = false; + let counter = 0; if (!cfg?.widgets || cfg?.widgets?.length <= 0) { return results; } @@ -35,12 +36,13 @@ export class DashboardsDataService { cfg, ); if (loadRes.result) { + counter++; isSuccess = true; loadRes.result.widgetId = widget.id; results.push({ data: loadRes.result, widgetId: widget.id }); } } - if (!isSuccess) throw createAppError('CANNOT_LOAD_DATA'); + if (!isSuccess && counter > 0) throw createAppError('CANNOT_LOAD_DATA'); return results; }