mirror of
https://github.com/bluewave-labs/Checkmate.git
synced 2026-04-27 12:09:29 -05:00
Add teamID to monitor on creation
This commit is contained in:
@@ -118,9 +118,11 @@ const CreateMonitor = () => {
|
||||
form = {
|
||||
...form,
|
||||
description: form.name,
|
||||
teamId: user.teamId,
|
||||
userId: user._id,
|
||||
notifications: monitor.notifications,
|
||||
};
|
||||
console.log(form);
|
||||
const action = await dispatch(
|
||||
createUptimeMonitor({ authToken, monitor: form })
|
||||
);
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -180,6 +180,7 @@ const getMonitorsByUserIdQueryValidation = joi.object({
|
||||
const createMonitorBodyValidation = joi.object({
|
||||
_id: joi.string(),
|
||||
userId: joi.string().required(),
|
||||
teamId: joi.string().required(),
|
||||
name: joi.string().required(),
|
||||
description: joi.string().required(),
|
||||
type: joi.string().required(),
|
||||
|
||||
Reference in New Issue
Block a user