Contact modal for mobile fixes
This commit is contained in:
@@ -94,18 +94,27 @@
|
||||
body = req.body;
|
||||
contactRequests = db.collection('contact_requests');
|
||||
|
||||
|
||||
if (!body.email) {
|
||||
res.status(422);
|
||||
res.end('Email is required');
|
||||
if (body.email) {
|
||||
_context.next = 8;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!body.name) {
|
||||
res.status(422);
|
||||
res.end('Name is required');
|
||||
res.status(422);
|
||||
res.end('Email is required');
|
||||
return _context.abrupt('return');
|
||||
|
||||
case 8:
|
||||
if (body.name) {
|
||||
_context.next = 12;
|
||||
break;
|
||||
}
|
||||
|
||||
_context.next = 8;
|
||||
res.status(422);
|
||||
res.end('Name is required');
|
||||
return _context.abrupt('return');
|
||||
|
||||
case 12:
|
||||
_context.next = 14;
|
||||
return contactRequests.insertOne({
|
||||
name: body.name,
|
||||
email: body.email,
|
||||
@@ -115,28 +124,28 @@
|
||||
alert: body.alert
|
||||
});
|
||||
|
||||
case 8:
|
||||
case 14:
|
||||
result = _context.sent;
|
||||
|
||||
|
||||
res.status(200);
|
||||
res.end();
|
||||
_context.next = 17;
|
||||
_context.next = 23;
|
||||
break;
|
||||
|
||||
case 13:
|
||||
_context.prev = 13;
|
||||
case 19:
|
||||
_context.prev = 19;
|
||||
_context.t0 = _context['catch'](0);
|
||||
|
||||
console.log('error:', _context.t0);
|
||||
next(_context.t0);
|
||||
|
||||
case 17:
|
||||
case 23:
|
||||
case 'end':
|
||||
return _context.stop();
|
||||
}
|
||||
}
|
||||
}, _callee, undefined, [[0, 13]]);
|
||||
}, _callee, undefined, [[0, 19]]);
|
||||
}));
|
||||
|
||||
return function (_x, _x2, _x3) {
|
||||
|
||||
Reference in New Issue
Block a user