From 1e94640f6e5184d086fe378355423a70c346eb1a Mon Sep 17 00:00:00 2001 From: Marcel Arndt Date: Thu, 26 Jun 2025 09:08:51 +0200 Subject: [PATCH] fix: prevent anomaly resolution when resolvedAt is falsey --- .../src/modules/feat-anomalies/anomalies.service.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/service/data-hub/data-connector/src/modules/feat-anomalies/anomalies.service.ts b/service/data-hub/data-connector/src/modules/feat-anomalies/anomalies.service.ts index 3d5c49b..1598c83 100644 --- a/service/data-hub/data-connector/src/modules/feat-anomalies/anomalies.service.ts +++ b/service/data-hub/data-connector/src/modules/feat-anomalies/anomalies.service.ts @@ -62,9 +62,11 @@ export class AnomaliesService { const validatedAnomalies = anomalies.flat(); const updatedAnomalies: Anomaly[] = []; for (const anomaly of validatedAnomalies) { - updatedAnomalies.push( - await this.anomalyService.resolveAnomaly(anomaly.id), - ); + if (anomaly.resolvedAt) { + updatedAnomalies.push( + await this.anomalyService.resolveAnomaly(anomaly.id), + ); + } } return updatedAnomalies; });