Added user_id and exp_id (disinction between both)
This commit is contained in:
@@ -3,23 +3,20 @@ var secret = require('../../private');
|
||||
|
||||
module.exports.index = function(req, res) {
|
||||
|
||||
var user_id = req.session.user_id;
|
||||
var camera = req.body.camera;
|
||||
|
||||
pg.connect(secret.url, function(err, client, release) {
|
||||
client.query(
|
||||
"INSERT INTO previousnextclicked(user_id, previousnext, time, camera)" +
|
||||
"INSERT INTO previousnextclicked(exp_id, previousnext, time, camera)" +
|
||||
"VALUES($1, $2, to_timestamp($3), ROW(ROW($4,$5,$6), ROW($7,$8,$9)));" ,
|
||||
[
|
||||
user_id,
|
||||
req.session.exp_id,
|
||||
req.body.previous ? 'p' : 'n',
|
||||
req.body.time,
|
||||
camera.position.x,
|
||||
camera.position.y,
|
||||
camera.position.z,
|
||||
camera.target.x,
|
||||
camera.target.y,
|
||||
camera.target.z
|
||||
req.body.camera.position.x,
|
||||
req.body.camera.position.y,
|
||||
req.body.camera.position.z,
|
||||
req.body.camera.target.x,
|
||||
req.body.camera.target.y,
|
||||
req.body.camera.target.z
|
||||
],
|
||||
function(err, result) {
|
||||
release();
|
||||
@@ -28,6 +25,6 @@ module.exports.index = function(req, res) {
|
||||
});
|
||||
|
||||
res.setHeader('Content-Type', 'text/html');
|
||||
res.send("user_id = " + user_id);
|
||||
res.send("");
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user