sanitized errors

This commit is contained in:
jackiettran
2025-11-26 15:49:42 -05:00
parent fab79e64ee
commit f2d3aac029
7 changed files with 113 additions and 116 deletions

View File

@@ -7,7 +7,7 @@ const emailServices = require('../services/email');
const router = express.Router();
// Submit new feedback
router.post('/', authenticateToken, sanitizeInput, validateFeedback, async (req, res) => {
router.post('/', authenticateToken, sanitizeInput, validateFeedback, async (req, res, next) => {
try {
const { feedbackText, url } = req.body;
@@ -59,7 +59,7 @@ router.post('/', authenticateToken, sanitizeInput, validateFeedback, async (req,
stack: error.stack,
userId: req.user.id
});
res.status(500).json({ error: error.message });
next(error);
}
});