mirror of
https://github.com/wassname/HackFlowy.git
synced 2026-07-18 12:10:24 +08:00
Sync parent_id with db;
* Update the corresponding query in `server.js` * Add js to focus input of new element created
This commit is contained in:
@@ -36,7 +36,7 @@ app.get('/tasks', function(req,res){
|
||||
|
||||
app.post('/tasks', function(req,res){
|
||||
var timestamp = Math.round((new Date()).getTime()/1000);
|
||||
client.query("INSERT INTO tasks (content, timestamp) VALUES (?,?)", [req.body.content,timestamp]);
|
||||
client.query("INSERT INTO tasks (content, timestamp, parent_id) VALUES (?,?,?)", [req.body.content,timestamp,req.body.parent_id]);
|
||||
client.query("SELECT * FROM tasks WHERE content = ?", [req.body.content], function select(err,task){
|
||||
req.body.id = task[0].id;
|
||||
res.send(req.body);
|
||||
|
||||
Reference in New Issue
Block a user