2015-05-20 15:20:59 +02:00
|
|
|
var pg = require('pg');
|
|
|
|
var secret = require('../../private');
|
2015-07-03 13:27:05 +02:00
|
|
|
var Log = require('../../lib/NodeLog.js');
|
2015-05-20 15:20:59 +02:00
|
|
|
|
|
|
|
module.exports.index = function(req, res) {
|
|
|
|
|
|
|
|
pg.connect(secret.url, function(err, client, release) {
|
|
|
|
client.query(
|
2015-06-04 16:52:58 +02:00
|
|
|
"INSERT INTO resetclicked(exp_id, time)" +
|
2015-05-20 15:20:59 +02:00
|
|
|
"VALUES($1, to_timestamp($2));" ,
|
|
|
|
[
|
2015-08-28 21:34:29 +02:00
|
|
|
req.session.expId,
|
2015-05-20 15:20:59 +02:00
|
|
|
req.body.time
|
|
|
|
],
|
|
|
|
function(err, result) {
|
2015-07-01 11:31:44 +02:00
|
|
|
if (err !== null)
|
2015-07-09 15:04:55 +02:00
|
|
|
Log.dberror(err + ' in reset-clicked');
|
2015-05-20 15:20:59 +02:00
|
|
|
release();
|
|
|
|
}
|
|
|
|
);
|
|
|
|
});
|
|
|
|
|
|
|
|
res.setHeader('Content-Type', 'text/html');
|
2015-06-04 16:52:58 +02:00
|
|
|
res.send("");
|
2015-05-20 15:20:59 +02:00
|
|
|
|
2015-07-01 10:14:15 +02:00
|
|
|
};
|