Merge branch 'master' into feat/speedcheck-controller
This commit is contained in:
9 files changed
+98
-222
No files matched your search
@@ -309,11 +309,12 @@ const validateRecoveryTokenController = async (req, res, next) => {
|
||||
const resetPasswordController = async (req, res, next) => {
|
||||
try {
|
||||
await newPasswordValidation.validateAsync(req.body);
|
||||
user = await req.db.resetPassword(req, res);
|
||||
const user = await req.db.resetPassword(req, res);
|
||||
const token = issueToken(user);
|
||||
res.status(200).json({
|
||||
success: true,
|
||||
msg: successMessages.AUTH_RESET_PASSWORD,
|
||||
data: user,
|
||||
data: { user, token },
|
||||
});
|
||||
} catch (error) {
|
||||
error.service = SERVICE_NAME;
|
||||
|
||||
@@ -14,12 +14,14 @@ const {
|
||||
* @param {string} monitorId - The ID of the monitor
|
||||
* @middleware verifyOwnership - Ensures the user owns the monitor
|
||||
*/
|
||||
|
||||
router.post(
|
||||
"/:monitorId",
|
||||
verifyOwnership(Monitor, "monitorId"),
|
||||
createPageSpeedCheck
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
* @route GET /:monitorId
|
||||
* @description Get all PageSpeedChecks for a monitor
|
||||
@@ -27,6 +29,7 @@ router.post(
|
||||
* @param {string} monitorId - The ID of the monitor
|
||||
* @middleware verifyOwnership - Ensures the user owns the monitor
|
||||
*/
|
||||
|
||||
router.get(
|
||||
"/:monitorId",
|
||||
verifyOwnership(Monitor, "monitorId"),
|
||||
@@ -40,10 +43,12 @@ router.get(
|
||||
* @param {string} monitorId - The ID of the monitor
|
||||
* @middleware verifyOwnership - Ensures the user owns the monitor
|
||||
*/
|
||||
router.post(
|
||||
"/delete/:monitorId",
|
||||
|
||||
router.delete(
|
||||
"/:monitorId",
|
||||
verifyOwnership(Monitor, "monitorId"),
|
||||
deletePageSpeedCheck
|
||||
);
|
||||
|
||||
|
||||
module.exports = router;
|
||||
Reference in new issue
Block a user