Populate table
This commit is contained in:
1 parent
b0182cff6d
commit
7b65debed6
9 files changed
+324
-27
No files matched your search
@@ -28,6 +28,7 @@ const createMaintenanceWindows = async (req, res, next) => {
|
||||
return req.db.createMaintenanceWindow({
|
||||
teamId,
|
||||
monitorId,
|
||||
name: req.body.name,
|
||||
active: req.body.active ? req.body.active : true,
|
||||
repeat: req.body.repeat,
|
||||
start: req.body.start,
|
||||
|
||||
@@ -43,6 +43,9 @@ const MaintenanceWindow = mongoose.Schema(
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
name: {
|
||||
type: String,
|
||||
},
|
||||
repeat: {
|
||||
type: Number,
|
||||
},
|
||||
|
||||
@@ -36,7 +36,7 @@ const createMaintenanceWindow = async (maintenanceWindowData) => {
|
||||
if (maintenanceWindowData.oneTime) {
|
||||
maintenanceWindow.expiry = maintenanceWindowData.end;
|
||||
}
|
||||
const result = maintenanceWindow.save();
|
||||
const result = await maintenanceWindow.save();
|
||||
return result;
|
||||
} catch (error) {
|
||||
error.service = SERVICE_NAME;
|
||||
|
||||
Reference in new issue
Block a user