Fixed bug
This commit is contained in:
parent
11cfc7bd34
commit
d0e3d4bc3e
|
@ -292,11 +292,14 @@ ExpCreator.prototype.execute = function() {
|
|||
var self = this;
|
||||
this.client.query(
|
||||
// TODO this is ugly, we should not do that...
|
||||
"INSERT INTO experiment(user_id, scene_id) VALUES(" + this.user_id + " , 1); SELECT currval('experiment_id_seq');",
|
||||
[],
|
||||
"INSERT INTO experiment(user_id, scene_id) VALUES($1,1);",
|
||||
[self.user_id],
|
||||
function(err, result) {
|
||||
self.finalResult = result.rows[0].currval;
|
||||
self.finish();
|
||||
self.client.query("SELECT MAX(id) AS id FROM experiment;", function(err, result) {
|
||||
self.finalResult = result.rows[0].id;
|
||||
console.log(self.finalResult);
|
||||
self.finish();
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue