Big Refactor of all SQL calls to comply with database changes

Added tag suggestions when entering tag field
Cleaned up animations to make them REAL smooth
This commit is contained in:
Max G committed 2019-07-30 20:27:26 +00:00
1 parent 0d86aa4ff9
commit b2dc6e5218
8 files changed
+111 -77

No files matched your search

+3 -3
View File
@@ -13,7 +13,7 @@ User.login = (username, password) => {
const lowerName = username.toLowerCase();
db.promise()
.query('SELECT * FROM users WHERE username = ? LIMIT 1', [lowerName])
.query('SELECT * FROM user WHERE username = ? LIMIT 1', [lowerName])
.then((rows, fields) => {
//Pull out user data from database results
@@ -58,7 +58,7 @@ User.create = (username, password) => {
return new Promise((resolve, reject) => {
db.promise()
.query('SELECT * FROM users WHERE username = ? LIMIT 1', [lowerName])
.query('SELECT * FROM user WHERE username = ? LIMIT 1', [lowerName])
.then((rows, fields) => {
if(rows[0].length === 0){ //No users returned, create new one. Start with hashing password
@@ -88,7 +88,7 @@ User.create = (username, password) => {
};
db.promise()
.query('INSERT INTO users SET ?', new_user)
.query('INSERT INTO user SET ?', new_user)
.then((rows, fields) => {
if(rows[0].affectedRows == 1){