Skip to content
Permalink
Browse files
Big bug fix. Made mistake with sql code, forgot to include WHERE. Fixed
  • Loading branch information
sultanh5 committed Jul 21, 2020
1 parent 51d7e7c commit 80605e2a43f1e929912d4bbd8003ff4ea05db707
Showing 1 changed file with 1 addition and 1 deletion.
@@ -65,7 +65,7 @@ module.exports = class User {
let sql = `SELECT COUNT(cvid) as records FROM cvs WHERE user="${user}";`
const data = await this.db.get(sql)
if(data.records == 0) throw new Error(`username "${user}" has no cv to update`)
sql = `UPDATE cvs SET user = "${user}", email = "${email.toLowerCase()}", fname = "${fname}", lname = "${lname}", shortsum = "${shortsum}", skills = "${skills}", qualifications = "${qualifications}";`
sql = `UPDATE cvs SET user = "${user}", email = "${email.toLowerCase()}", fname = "${fname}", lname = "${lname}", shortsum = "${shortsum}", skills = "${skills}", qualifications = "${qualifications}" WHERE user = "${user}"`
await this.db.run(sql)
return true
}

0 comments on commit 80605e2

Please sign in to comment.