Skip to content

Commit a89de19

Browse files
committed
feat(models): add extra fields for update and create notification rule methods
1 parent 3824ced commit a89de19

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/models/project.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,11 @@ export default class ProjectModel extends AbstractModel<ProjectDBScheme> impleme
262262
excluding: payload.excluding,
263263
};
264264

265+
if (rule.whatToReceive === ReceiveTypes.SEEN_MORE) {
266+
rule.threshold = payload.threshold;
267+
rule.thresholdPeriod = payload.thresholdPeriod;
268+
}
269+
265270
await this.collection.updateOne({
266271
_id: this._id,
267272
},
@@ -291,6 +296,11 @@ export default class ProjectModel extends AbstractModel<ProjectDBScheme> impleme
291296
excluding: payload.excluding,
292297
};
293298

299+
if (rule.whatToReceive === ReceiveTypes.SEEN_MORE) {
300+
rule.threshold = payload.threshold;
301+
rule.thresholdPeriod = payload.thresholdPeriod;
302+
}
303+
294304
const result = await this.collection.findOneAndUpdate(
295305
{
296306
_id: this._id,

0 commit comments

Comments
 (0)