dt-common-device 9.1.0 → 9.1.1

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.
@@ -606,7 +606,7 @@ let AlertService = (() => {
606
606
  if (alerts.length > 1) {
607
607
  throw new Error("Multiple alerts found, please specify a more specific query");
608
608
  }
609
- const alert = await Alert_model_1.AlertModel.findById(alerts[0]._id);
609
+ const alert = await Alert_model_1.AlertModel.findById(alerts[0]._id || alerts[0].id);
610
610
  if (!alert)
611
611
  return null;
612
612
  alert.deactivate(updatedBy);
@@ -619,9 +619,7 @@ let AlertService = (() => {
619
619
  if (!id || !updatedBy) {
620
620
  throw new Error("Alert ID and updated by user are required");
621
621
  }
622
- if (!until) {
623
- until = new Date(Date.now() + 1000 * 60 * 60 * 24); // 1 day
624
- }
622
+ until ?? (until = new Date(Date.now() + 1000 * 60 * 60 * 24)); // 1 day
625
623
  // Business logic: Validate snooze date
626
624
  this.validateSnoozeDate(until);
627
625
  const alertModel = await Alert_model_1.AlertModel.findById(id);
@@ -580,7 +580,7 @@ let IssueService = (() => {
580
580
  });
581
581
  }
582
582
  // Add comment using the model instance methods
583
- const issueModel = await Issue_model_1.IssueModel.findById({ _id: issueId });
583
+ const issueModel = await Issue_model_1.IssueModel.findById(issueId);
584
584
  if (issueModel) {
585
585
  issueModel.addComment(commentData);
586
586
  return await issueModel.save();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dt-common-device",
3
- "version": "9.1.0",
3
+ "version": "9.1.1",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [