added login and sign Funtion properly
This commit is contained in:
@ -15,8 +15,9 @@ import {
|
||||
//insert user to databased
|
||||
export const signUp = async (req, res, next) => {
|
||||
try {
|
||||
let sql = `SELECT id FROM users WHERE LOWER(username) = LOWER(?)`;
|
||||
let sql = `SELECT id FROM users WHERE LOWER(username) = LOWER(?)`;
|
||||
const result = await ownConn.execute(sql, [req.body.username])
|
||||
|
||||
if (result.length > 0) { //username already exists
|
||||
return res.status(409).send({
|
||||
message: 'This username is already in use!'
|
||||
|
||||
Reference in New Issue
Block a user