fix:format code

This commit is contained in:
ashu130698 committed 2026-03-13 21:40:28 +05:30
1 parent 88a39fe502
commit 1706012e54
4 files changed
+14 -6

No files matched your search

+2 -2
View File
@@ -415,7 +415,7 @@ class MonitorController {
if (invalidIds.length > 0) { if (invalidIds.length > 0) {
throw new AppError({ throw new AppError({
message: `The following notification IDs are invalid or do not belong to your team: ${invalidIds.join(", ")}`, message: `The following notification IDs are invalid or do not belong to your team: ${invalidIds.join(", ")}`,
status: 403 status: 403,
}); });
} }
@@ -423,7 +423,7 @@ class MonitorController {
teamId, teamId,
monitorIds, monitorIds,
notificationIds, notificationIds,
action action,
}); });
return res.status(200).json({ return res.status(200).json({
@@ -126,7 +126,6 @@ class NotificationController {
} }
}; };
testAllNotifications = async (req: Request, res: Response, next: NextFunction) => { testAllNotifications = async (req: Request, res: Response, next: NextFunction) => {
try { try {
const validatedBody = testAllNotificationsBodyValidation.parse(req.body); const validatedBody = testAllNotificationsBodyValidation.parse(req.body);
-1
View File
@@ -17,7 +17,6 @@ class NotificationRoutes {
this.router.get("/team", this.notificationController.getNotificationsByTeamId); this.router.get("/team", this.notificationController.getNotificationsByTeamId);
this.router.get("/:id", this.notificationController.getNotificationById); this.router.get("/:id", this.notificationController.getNotificationById);
this.router.delete("/:id", this.notificationController.deleteNotification); this.router.delete("/:id", this.notificationController.deleteNotification);
this.router.patch("/:id", this.notificationController.editNotification); this.router.patch("/:id", this.notificationController.editNotification);
+12 -2
View File
@@ -438,13 +438,23 @@ export class MonitorService implements IMonitorService {
return editedMonitor; return editedMonitor;
}; };
updateNotifications = async ({ teamId, monitorIds, notificationIds, action }: { teamId: string; monitorIds: string[]; notificationIds: string[]; action: "add" | "remove" | "set" }): Promise<number> => { updateNotifications = async ({
teamId,
monitorIds,
notificationIds,
action,
}: {
teamId: string;
monitorIds: string[];
notificationIds: string[];
action: "add" | "remove" | "set";
}): Promise<number> => {
const modifiedCount = await this.monitorsRepository.updateNotifications(monitorIds, notificationIds, action, teamId); const modifiedCount = await this.monitorsRepository.updateNotifications(monitorIds, notificationIds, action, teamId);
// If notifications were updated, we should update the jobs in the queue // If notifications were updated, we should update the jobs in the queue
if (modifiedCount > 0) { if (modifiedCount > 0) {
const monitors = await this.monitorsRepository.findByIds(monitorIds); const monitors = await this.monitorsRepository.findByIds(monitorIds);
await Promise.all(monitors.map(monitor => this.jobQueue.updateJob(monitor))); await Promise.all(monitors.map((monitor) => this.jobQueue.updateJob(monitor)));
} }
return modifiedCount; return modifiedCount;