3d-interface/posts/reset-clicked/index.js

24 lines
553 B
JavaScript
Raw Normal View History

2015-05-20 15:20:59 +02:00
var pg = require('pg');
var secret = require('../../private');
module.exports.index = function(req, res) {
pg.connect(secret.url, function(err, client, release) {
client.query(
"INSERT INTO resetclicked(exp_id, time)" +
2015-05-20 15:20:59 +02:00
"VALUES($1, to_timestamp($2));" ,
[
req.session.exp_id,
2015-05-20 15:20:59 +02:00
req.body.time
],
function(err, result) {
release();
}
);
});
res.setHeader('Content-Type', 'text/html');
res.send("");
2015-05-20 15:20:59 +02:00
}