mirror of
https://github.com/bluewave-labs/Checkmate.git
synced 2026-01-16 06:39:43 -06:00
48 lines
1.3 KiB
JavaScript
48 lines
1.3 KiB
JavaScript
const express = require("express");
|
|
const {} = require("../validation/joi");
|
|
const logger = require("../utils/logger");
|
|
require("dotenv").config();
|
|
const { createAlertParamValidation } = require("../validation/joi");
|
|
|
|
const SERVICE_NAME = "alerts";
|
|
|
|
const createAlert = async (req, res, next) => {
|
|
try {
|
|
await createAlertParamValidation.validateAsync(req.params);
|
|
res
|
|
.status(200)
|
|
.json({ success: true, msg: "Create Alert", data: req.params.monitorId });
|
|
} catch (error) {
|
|
error.service = SERVICE_NAME;
|
|
next(error);
|
|
}
|
|
};
|
|
const getAlertsByUserId = (req, res, next) => {
|
|
res.status(200).json({
|
|
success: true,
|
|
msg: "Get Alerts By UserID",
|
|
data: req.params.userId,
|
|
});
|
|
};
|
|
const getAlertsByMonitorId = (req, res, next) => {
|
|
res.status(200).json({ success: true, msg: "Get Alerts By MonitorID" });
|
|
};
|
|
const getAlertById = (req, res, next) => {
|
|
res.status(200).json({ success: true, msg: "Get Alert By alertID" });
|
|
};
|
|
const editAlert = (req, res, next) => {
|
|
res.status(200).json({ success: true, msg: "Edit alert" });
|
|
};
|
|
const deleteAlert = (req, res, next) => {
|
|
res.status(200).json({ success: true, msg: "Delete alert" });
|
|
};
|
|
|
|
module.exports = {
|
|
createAlert,
|
|
getAlertsByUserId,
|
|
getAlertsByMonitorId,
|
|
getAlertById,
|
|
editAlert,
|
|
deleteAlert,
|
|
};
|