wire repo and service
This commit is contained in:
1 parent
edd9335e96
commit
6e3252aec8
5 files changed
+41
-5
No files matched your search
@@ -53,6 +53,7 @@ export interface IMonitorsRepository {
|
||||
|
||||
// counts
|
||||
findMonitorCountByTeamIdAndType(teamId: string, config: TeamQueryConfig): Promise<number>;
|
||||
findMonitorCountByProxyId(proxyId: string): Promise<number>;
|
||||
|
||||
// other
|
||||
findMonitorsSummaryByTeamId(teamId: string, config?: SummaryConfig): Promise<MonitorsSummary>;
|
||||
|
||||
@@ -172,6 +172,11 @@ class MongoMonitorsRepository implements IMonitorsRepository {
|
||||
return count;
|
||||
};
|
||||
|
||||
findMonitorCountByProxyId = async (proxyId: string): Promise<number> => {
|
||||
const count = await MonitorModel.countDocuments({ proxyId });
|
||||
return count;
|
||||
};
|
||||
|
||||
updateById = async (monitorId: string, teamId: string, patch: Partial<Monitor>) => {
|
||||
const updatedMonitor = await MonitorModel.findOneAndUpdate(
|
||||
{ _id: monitorId, teamId },
|
||||
|
||||
Reference in new issue
Block a user