fix(dashboard-widget): answer 404 for an unknown widget update

Merged
CE
7d ago
+56-0

Problem

DashboardWidgetService.update wraps every error in HttpException(..., 400), including the NotFoundException from findOneByIdString and from its own not-found check: updating an unknown widget answered 400 instead of 404. DashboardService.update already keeps the 404.

Fix

Rethrow NotFoundException unchanged, as DashboardService.update does; other failures still map to 400.

Tests

dashboard-widget.service.spec.ts: a lookup that throws not-found, or returns null, gives a NotFoundException and saves nothing; a failed save still gives a 400 and logs no activity.

Notes

Not built or run locally.


Summary by cubic

Fixes DashboardWidgetService.update so updating an unknown widget answers 404 instead of 400.

  • Rethrows NotFoundException unchanged, matching DashboardService.update; other failures still map to 400.
  • Adds tests covering not-found lookups, null lookups, and save failures.