remove incidents on delete
This commit is contained in:
1 parent
af8083bdaa
commit
97750da889
5 files changed
+49
-1
No files matched your search
@@ -273,5 +273,13 @@ class MongoIncidentRepository implements IIncidentsRepository {
|
||||
})),
|
||||
};
|
||||
};
|
||||
|
||||
deleteByMonitorId = async (monitorId: string, teamId: string) => {
|
||||
const result = await IncidentModel.deleteMany({
|
||||
monitorId: new mongoose.Types.ObjectId(monitorId),
|
||||
teamId: new mongoose.Types.ObjectId(teamId),
|
||||
});
|
||||
return result.deletedCount || 0;
|
||||
};
|
||||
}
|
||||
export default MongoIncidentRepository;
|
||||
Reference in new issue
Block a user