Added user_id and exp_id (disinction between both)
This commit is contained in:
@@ -3,13 +3,10 @@ var secret = require('../../private');
|
||||
|
||||
module.exports.index = function(req, res) {
|
||||
|
||||
var user_id = req.session.user_id;
|
||||
var arrow_id = req.body.arrow_id;
|
||||
|
||||
pg.connect(secret.url, function(err, client, release) {
|
||||
client.query(
|
||||
"INSERT INTO arrowclicked(user_id, arrow_id, time) VALUES($1,$2, to_timestamp($3));",
|
||||
[user_id, arrow_id, req.body.time],
|
||||
"INSERT INTO arrowclicked(exp_id, arrow_id, time) VALUES($1,$2, to_timestamp($3));",
|
||||
[req.session.exp_id, req.body.arrow_id, req.body.time],
|
||||
function(err, result) {
|
||||
release();
|
||||
}
|
||||
@@ -17,6 +14,4 @@ module.exports.index = function(req, res) {
|
||||
});
|
||||
|
||||
res.setHeader('Content-Type', 'text/html');
|
||||
res.send("user_id = " + user_id);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user