Add teamID to monitor on creation

This commit is contained in:
Alex Holliday committed 2024-08-26 19:25:19 -07:00
1 parent a02f547b2c
commit e658b4759a
3 files changed
+4 -1

No files matched your search

+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) {