remove delete, use undefined instead
This commit is contained in:
1 parent
9f62edf6dc
commit
905d6ed658
1 file changed
+1
-1
@@ -140,7 +140,7 @@ const createMonitor = async (req, res) => {
|
|||||||
try {
|
try {
|
||||||
const monitor = new Monitor({ ...req.body });
|
const monitor = new Monitor({ ...req.body });
|
||||||
// Remove notifications fom monitor as they aren't needed here
|
// Remove notifications fom monitor as they aren't needed here
|
||||||
delete monitor.notifications;
|
monitor.notifications = undefined;
|
||||||
monitor.userId = req.user._id;
|
monitor.userId = req.user._id;
|
||||||
await monitor.save();
|
await monitor.save();
|
||||||
return monitor;
|
return monitor;
|
||||||
|
|||||||
Reference in new issue
Block a user