Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const checkEmail = require('./check_email');
const sendemail = require('sendemail');
const env = require('env2')('config.env');
const email = sendemail.email;
sendemail.set_template_directory('src/email_templates');
const {getForm} = require('../model/form_queries');
const {mergeObj, addData} = require('./helpers.js');
exports.post = (req, res) => {
getForm(req.session.id)
.then((data) => {
const person = {
name: req.session.user,
email: req.body.email,
subject: 'All about me questionnaire'
};
const cleanData = mergeObj(data);
addData(person, cleanData);