Used proper name for validation schema in speed check controller.
This commit is contained in:
1 parent
7d179042c2
commit
683006ae84
1 file changed
+4
-4
@@ -1,7 +1,7 @@
|
||||
const PageSpeedCheck = require("../models/PageSpeedCheck");
|
||||
const { successMessages } = require("../utils/messages");
|
||||
const SERVICE_NAME = "pagespeed";
|
||||
const { getMonitorByIdValidation } = require("../validation/joi");
|
||||
const { pageSpeedCheckValidation } = require("../validation/joi");
|
||||
|
||||
/**
|
||||
* Gets all PageSpeedChecks for a monitor
|
||||
@@ -14,7 +14,7 @@ const { getMonitorByIdValidation } = require("../validation/joi");
|
||||
const getPageSpeedChecks = async (req, res, next) => {
|
||||
try {
|
||||
// Validate monitorId parameter
|
||||
const { error } = getMonitorByIdValidation.validate(req.params);
|
||||
const { error } = pageSpeedCheckValidation.validate(req.params);
|
||||
if (error) {
|
||||
return res.status(400).json({ error: error.details[0].message });
|
||||
}
|
||||
@@ -36,7 +36,7 @@ const getPageSpeedChecks = async (req, res, next) => {
|
||||
const createPageSpeedCheck = async (req, res, next) => {
|
||||
try {
|
||||
// Validate monitorId parameter
|
||||
const { error } = getMonitorByIdValidation.validate(req.params);
|
||||
const { error } = pageSpeedCheckValidation.validate(req.params);
|
||||
if (error) {
|
||||
return res.status(400).json({ error: error.details[0].message });
|
||||
}
|
||||
@@ -59,7 +59,7 @@ const createPageSpeedCheck = async (req, res, next) => {
|
||||
const deletePageSpeedCheck = async (req, res, next) => {
|
||||
try {
|
||||
// Validate monitorId parameter
|
||||
const { error } = getMonitorByIdValidation.validate(req.params);
|
||||
const { error } = pageSpeedCheckValidation.validate(req.params);
|
||||
if (error) {
|
||||
return res.status(400).json({ error: error.details[0].message });
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user