Add teamID to monitor on creation

This commit is contained in:
Alex Holliday
2024-08-26 19:25:19 -07:00
parent a02f547b2c
commit e658b4759a
3 changed files with 4 additions and 1 deletions
+1 -1
View File
@@ -364,10 +364,10 @@ const getMonitorsByUserId = async (req, res) => {
*/
const createMonitor = async (req, res) => {
try {
console.log(req.body);
const monitor = new Monitor({ ...req.body });
// Remove notifications fom monitor as they aren't needed here
monitor.notifications = undefined;
monitor.userId = req.user._id;
await monitor.save();
return monitor;
} catch (error) {