Added user_id and exp_id (disinction between both)

This commit is contained in:
Thomas FORGIONE
2015-06-04 16:52:58 +02:00
parent c82f735273
commit fa063a0f91
10 changed files with 185 additions and 89 deletions

View File

@@ -3,14 +3,12 @@ var secret = require('../../private');
module.exports.index = function(req, res) {
var user_id = req.session.user_id;
pg.connect(secret.url, function(err, client, release) {
client.query(
"INSERT INTO hovered(user_id, time, start, arrow_id)" +
"INSERT INTO hovered(exp_id, time, start, arrow_id)" +
"VALUES($1, to_timestamp($2), $3, $4);" ,
[
user_id,
req.session.exp_id,
req.body.time,
req.body.start ? true : false,
req.body.arrow_id
@@ -22,6 +20,5 @@ module.exports.index = function(req, res) {
});
res.setHeader('Content-Type', 'text/html');
res.send("user_id = " + user_id);
res.send("");
}