This commit is contained in:
Alex Holliday committed 2025-11-26 22:22:15 +00:00
1 parent c50b0cbfd6
commit 8774042725
5 files changed
+49 -2

No files matched your search

@@ -26,6 +26,7 @@ export interface IMonitorService {
getAll: (teamId: string) => Promise<IMonitor[]>;
getAllEmbedChecks: (
teamId: string,
search: string,
sortField: string,
sortOrder: string,
page: number,
@@ -104,6 +105,7 @@ class MonitorService implements IMonitorService {
getAllEmbedChecks = async (
teamId: string,
search: string,
sortField: string,
sortOrder: string,
page: number,
@@ -117,6 +119,14 @@ class MonitorService implements IMonitorService {
teamId: teamObjectId,
};
if (search && search.trim() !== "") {
const term = search.trim();
(matchConditions as any).$or = [
{ name: { $regex: term, $options: "i" } },
{ url: { $regex: term, $options: "i" } },
];
}
if (Array.isArray(type) && type.length > 0) {
matchConditions.type = { $in: type };
}