dt-common-device 13.0.13 → 13.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -603,14 +603,14 @@ let AlertService = (() => {
603
603
  const alerts = await this.queryAlerts(query);
604
604
  if (!alerts.length)
605
605
  return null;
606
- if (alerts.length > 1) {
607
- throw new Error("Multiple alerts found, please specify a more specific query");
606
+ for (const alert of alerts) {
607
+ const alertModel = await Alert_model_1.AlertModel.findById(alert._id || alert.id);
608
+ if (!alertModel)
609
+ return null;
610
+ alertModel.deactivate(updatedBy);
611
+ await alertModel.save();
608
612
  }
609
- const alert = await Alert_model_1.AlertModel.findById(alerts[0]._id || alerts[0].id);
610
- if (!alert)
611
- return null;
612
- alert.deactivate(updatedBy);
613
- return await alert.save();
613
+ return null;
614
614
  }
615
615
  /**
616
616
  * Snooze an alert with business logic
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dt-common-device",
3
- "version": "13.0.13",
3
+ "version": "13.0.14",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [