remove delete, use undefined instead

This commit is contained in:
Alex Holliday committed 2024-07-31 12:27:40 -07:00
1 parent 9f62edf6dc
commit 905d6ed658
1 file changed
+1 -1
+1 -1
View File
@@ -140,7 +140,7 @@ const createMonitor = async (req, res) => {
try {
const monitor = new Monitor({ ...req.body });
// Remove notifications fom monitor as they aren't needed here
delete monitor.notifications;
monitor.notifications = undefined;
monitor.userId = req.user._id;
await monitor.save();
return monitor;