Error getting query in node.js

0

I am making an agenda for myself (without any security). To add, delete or update I use GET to notify the server that I am adding a task. The address would be this:

  

link

Afterwards, to get the query in node.js, I use this code:

if (url_parts.pathname == "/update") {           
    var start = url_parts.query.start;
    var end = url_parts.query.end;
    var status = url_parts.query.status;
    var by = url_parts.query.by;
    var title = url_parts.query.title;
    var content = url_parts.query.content;
    var to = url_parts.query.to;
    var priority = url_parts.query.priority;
    var color = url_parts.query.color;
    var qid = url_parts.query.qid;
    db.run("UPDATE todo SET id="+qid+",start="+start+",end="+end+",title=\""+title+"\", content=\""+content+"\", status=\""+status+"\", importance="+priority+", user=\""+to+"\", by=\""+by+"\", color=\""+color+"\" WHERE id="+qid);
    res.end();
}

The update function works perfectly. The only problem is that the two new fields I added today ( qid and status ) return undefined . The error persists after restarting the computer and node. What can cause the problem? Thank you very much.

    
asked by JoséM 05.09.2018 в 00:20
source

1 answer

2

The character # in the request (&color=#ff0000) gave the error and did not send the complete request.

Many thanks to user ValVert for trying to fix it.

    
answered by 05.09.2018 / 16:40
source