Add route, controller, and DB methods for fetching maintenance window by ID
This commit is contained in:
1 parent
114cfd6cb7
commit
e3c0944062
10 files changed
+143
-16
No files matched your search
@@ -45,6 +45,19 @@ const createMaintenanceWindow = async (maintenanceWindowData) => {
|
||||
}
|
||||
};
|
||||
|
||||
const getMaintenanceWindowById = async (maintenanceWindowId) => {
|
||||
try {
|
||||
const maintenanceWindow = await MaintenanceWindow.findById({
|
||||
_id: maintenanceWindowId,
|
||||
});
|
||||
return maintenanceWindow;
|
||||
} catch (error) {
|
||||
error.service = SERVICE_NAME;
|
||||
error.method = "getMaintenanceWindowById";
|
||||
throw error;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Asynchronously retrieves all MaintenanceWindow documents associated with a specific team ID.
|
||||
* @async
|
||||
@@ -202,6 +215,7 @@ const editMaintenanceWindowById = async (
|
||||
|
||||
module.exports = {
|
||||
createMaintenanceWindow,
|
||||
getMaintenanceWindowById,
|
||||
getMaintenanceWindowsByTeamId,
|
||||
getMaintenanceWindowsByMonitorId,
|
||||
deleteMaintenanceWindowById,
|
||||
|
||||
Reference in new issue
Block a user