fix: prevent anomaly resolution when resolvedAt is falsey
This commit is contained in:
parent
a5768054ff
commit
1e94640f6e
|
|
@ -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;
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue