auth service

This commit is contained in:
Alex Holliday committed 2026-01-03 20:47:02 +00:00
1 parent e5ef14215f
commit e2b012fdde
5 files changed
+77 -9

No files matched your search

@@ -57,6 +57,7 @@ export interface IMonitorRepository {
findByOrgId(orgId: string): Promise<Monitor[]>;
// Deletions
deleteAll(): Promise<boolean>;
deleteById(monitorId: string, teamId: string): Promise<boolean>;
deleteByOrgId(orgId: string): Promise<boolean>;
@@ -143,6 +143,10 @@ class MongoMonitorRepository implements IMonitorRepository {
};
// Deletions
deleteAll = async () => {
const deleted = await Monitor.deleteMany({});
return deleted.acknowledged;
};
deleteById = async (monitorId: string, teamId: string) => {
await Monitor.deleteOne({ _id: monitorId, teamId });
return true;