Nodejs Mysql [object object] error and i cant insert any data on my database
I create a register page , when i insert all the fields and i submit a message appears on top the form "[object object]" and no data is added on the database The code : if(check){ reject(`This email " ${user.email}"Has already exist.Please choose an other email`); }else{ //hash the user password let salt =bcryptjs.genSaltSync(10); let data = { fullName: user.fullName, email: user.email, password: bcryptjs.hashSync(user.password, salt) } connection.query("INSERT INTO users set ? ", data, function(error,rows){ if(error){ reject(error); } resolve("Create a new user successfully"); }) } } catch (e) { reject(e); } });