fix: prevent anomaly resolution when resolvedAt is falsey

This commit is contained in:
Marcel Arndt 2025-06-26 09:08:51 +02:00
parent a5768054ff
commit 1e94640f6e
1 changed files with 5 additions and 3 deletions

View File

@ -62,10 +62,12 @@ export class AnomaliesService {
const validatedAnomalies = anomalies.flat(); const validatedAnomalies = anomalies.flat();
const updatedAnomalies: Anomaly[] = []; const updatedAnomalies: Anomaly[] = [];
for (const anomaly of validatedAnomalies) { for (const anomaly of validatedAnomalies) {
if (anomaly.resolvedAt) {
updatedAnomalies.push( updatedAnomalies.push(
await this.anomalyService.resolveAnomaly(anomaly.id), await this.anomalyService.resolveAnomaly(anomaly.id),
); );
} }
}
return updatedAnomalies; return updatedAnomalies;
}); });
} }