Fixed var name
This commit is contained in:
1 parent
9e51cffb67
commit
0c1af23f66
1 file changed
+2
-2
@@ -233,10 +233,10 @@ const editMonitor = async (req, res, next) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const jobBeforeEdit = await req.db.getMonitorById(req, res);
|
const monitorBeforeEdit = await req.db.getMonitorById(req, res);
|
||||||
const editedMonitor = await req.db.editMonitor(req, res);
|
const editedMonitor = await req.db.editMonitor(req, res);
|
||||||
// Delete the old job(editedMonitor has the same ID as the old monitor)
|
// Delete the old job(editedMonitor has the same ID as the old monitor)
|
||||||
await req.jobQueue.deleteJob(jobBeforeEdit);
|
await req.jobQueue.deleteJob(monitorBeforeEdit);
|
||||||
// Add the new job back to the queue
|
// Add the new job back to the queue
|
||||||
await req.jobQueue.addJob(editedMonitor._id, editedMonitor);
|
await req.jobQueue.addJob(editedMonitor._id, editedMonitor);
|
||||||
return res.status(200).json({
|
return res.status(200).json({
|
||||||
|
|||||||
Reference in new issue
Block a user