fix: Remove references to "privacyAccepted" and "privacy_accepted" from contactController and contactRoutes

This commit is contained in:
2025-08-26 11:48:04 -05:00
parent 8c3c574ddc
commit efc045ede4
2 changed files with 2 additions and 9 deletions

View File

@@ -8,13 +8,11 @@ module.exports = (pool, transporter) => {
phone, phone,
contactMethod, contactMethod,
message, message,
privacyAccepted
} = req.body; } = req.body;
if ( if (
!firstName || !lastName || !email || !message || !firstName || !lastName || !email || !message ||
typeof contactMethod === 'undefined' || typeof contactMethod === 'undefined'
typeof privacyAccepted === 'undefined'
) { ) {
console.error('Missing required fields in submission:', req.body); console.error('Missing required fields in submission:', req.body);
return res.status(400).json({ message: 'Missing required form fields.' }); return res.status(400).json({ message: 'Missing required form fields.' });
@@ -30,7 +28,6 @@ module.exports = (pool, transporter) => {
phone, phone,
contact_method, contact_method,
message, message,
privacy_accepted,
time_submitted time_submitted
) VALUES($1, $2, $3, $4, $5, $6, $7, $8, NOW()) ) VALUES($1, $2, $3, $4, $5, $6, $7, $8, NOW())
RETURNING *`, RETURNING *`,
@@ -42,7 +39,6 @@ module.exports = (pool, transporter) => {
phone, phone,
contactMethod, contactMethod,
message, message,
privacyAccepted
] ]
); );
@@ -61,7 +57,6 @@ module.exports = (pool, transporter) => {
<li><strong>Email:</strong> ${email}</li> <li><strong>Email:</strong> ${email}</li>
<li><strong>Phone:</strong> ${phone}</li> <li><strong>Phone:</strong> ${phone}</li>
<li><strong>Contact Method:</strong> ${contactMethod}</li> <li><strong>Contact Method:</strong> ${contactMethod}</li>
<li><strong>Privacy Policy Accepted:</strong> ${privacyAccepted}</li>
<li><strong>Submission Time:</strong> ${result.rows[0].time_submitted}</li> <li><strong>Submission Time:</strong> ${result.rows[0].time_submitted}</li>
</ul> </ul>
<p><strong>Message:</strong></p> <p><strong>Message:</strong></p>

View File

@@ -24,8 +24,6 @@ module.exports = (contactController, securityMw) => {
body('contactMethod') body('contactMethod')
.notEmpty().withMessage('Contact method is required.') .notEmpty().withMessage('Contact method is required.')
.isIn(['email', 'phone']).withMessage('Contact method must be email or phone.'), .isIn(['email', 'phone']).withMessage('Contact method must be email or phone.'),
body('privacyAccepted')
.isBoolean().withMessage('Privacy acceptance must be true or false.'),
], ],
(req, res, next) => { (req, res, next) => {
const errors = validationResult(req); const errors = validationResult(req);