fix: Remove references to "privacyAccepted" and "privacy_accepted" from contactController and contactRoutes
This commit is contained in:
@@ -8,13 +8,11 @@ module.exports = (pool, transporter) => {
|
||||
phone,
|
||||
contactMethod,
|
||||
message,
|
||||
privacyAccepted
|
||||
} = req.body;
|
||||
|
||||
if (
|
||||
!firstName || !lastName || !email || !message ||
|
||||
typeof contactMethod === 'undefined' ||
|
||||
typeof privacyAccepted === 'undefined'
|
||||
typeof contactMethod === 'undefined'
|
||||
) {
|
||||
console.error('Missing required fields in submission:', req.body);
|
||||
return res.status(400).json({ message: 'Missing required form fields.' });
|
||||
@@ -30,7 +28,6 @@ module.exports = (pool, transporter) => {
|
||||
phone,
|
||||
contact_method,
|
||||
message,
|
||||
privacy_accepted,
|
||||
time_submitted
|
||||
) VALUES($1, $2, $3, $4, $5, $6, $7, $8, NOW())
|
||||
RETURNING *`,
|
||||
@@ -42,7 +39,6 @@ module.exports = (pool, transporter) => {
|
||||
phone,
|
||||
contactMethod,
|
||||
message,
|
||||
privacyAccepted
|
||||
]
|
||||
);
|
||||
|
||||
@@ -61,7 +57,6 @@ module.exports = (pool, transporter) => {
|
||||
<li><strong>Email:</strong> ${email}</li>
|
||||
<li><strong>Phone:</strong> ${phone}</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>
|
||||
</ul>
|
||||
<p><strong>Message:</strong></p>
|
||||
|
@@ -24,8 +24,6 @@ module.exports = (contactController, securityMw) => {
|
||||
body('contactMethod')
|
||||
.notEmpty().withMessage('Contact method is required.')
|
||||
.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) => {
|
||||
const errors = validationResult(req);
|
||||
|
Reference in New Issue
Block a user