Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
exports.create = (req, res) => {
const meetupCreate = {
createdOn: dateTime(),
location: req.body.location,
topic: req.body.topic,
happeningOn: req.body.happeningOn,
tags: req.body.tags
};
db.query("INSERT INTO meetup (createdon, location, topic, happeningon, tags) VALUES ($1,$2,$3,$4,$5) returning *", [
meetupCreate.createdOn, meetupCreate.location, meetupCreate.topic, meetupCreate.happeningOn, meetupCreate.tags
], (err, result) => {
if (err) {
return res.status(500).json(err);
}
return res.status(200).json({
status: 200,
data: result.rows
});
});
exports.Upcoming = (req, res) => {
const currentTime = dateTime();
db.query('SELECT * FROM meetup WHERE happeningon > $1', [currentTime], (err, result) => {
if (err) {
throw err;
}
res.status(200).json({
status: 200,
data: result.rows
});
});
};
function goldlog(data = {}) {
data.visit_time = dateTime();
data.UA = UA;
return axios({
method: 'post',
url: `${appConfig.apiUrl}goldlog/record`,
data,
});
}