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,9 +62,11 @@ 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) {
updatedAnomalies.push( if (anomaly.resolvedAt) {
await this.anomalyService.resolveAnomaly(anomaly.id), updatedAnomalies.push(
); await this.anomalyService.resolveAnomaly(anomaly.id),
);
}
} }
return updatedAnomalies; return updatedAnomalies;
}); });