node
This commit is contained in:
1 parent
284253638b
commit
b3fab31a61
5 files changed
+43
-9
No files matched your search
@@ -2,6 +2,7 @@ const {
|
||||
createCheckParamValidation,
|
||||
createCheckBodyValidation,
|
||||
getChecksParamValidation,
|
||||
getChecksQueryValidation,
|
||||
deleteChecksParamValidation,
|
||||
} = require("../validation/joi");
|
||||
const { successMessages } = require("../utils/messages");
|
||||
@@ -35,6 +36,7 @@ const createCheck = async (req, res, next) => {
|
||||
const getChecks = async (req, res, next) => {
|
||||
try {
|
||||
await getChecksParamValidation.validateAsync(req.params);
|
||||
await getChecksQueryValidation.validateAsync(req.query);
|
||||
} catch (error) {
|
||||
error.status = 422;
|
||||
error.service = SERVICE_NAME;
|
||||
@@ -45,7 +47,7 @@ const getChecks = async (req, res, next) => {
|
||||
}
|
||||
|
||||
try {
|
||||
const checks = await req.db.getChecks(req.params.monitorId);
|
||||
const checks = await req.db.getChecks(req);
|
||||
return res
|
||||
.status(200)
|
||||
.json({ success: true, msg: successMessages.CHECK_GET, data: checks });
|
||||
|
||||
Reference in new issue
Block a user