-
Notifications
You must be signed in to change notification settings - Fork 451
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kyle Baker #485
base: master
Are you sure you want to change the base?
Kyle Baker #485
Conversation
Make sure to |
data/helpers/noteModel.js
Outdated
return db('notes') | ||
.where('id', id) | ||
.update(changes) | ||
.then(count => (count > 0 ? this.get(id) : null)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't have to have the > 0
const saltRounds = 10; | ||
|
||
if (!user_name || !email || !password || !name) { | ||
console.log('Missing information'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sure to remove the console.log
statements when commiting
console.log('Missing information'); |
return res.status(400).json({ error: "Missing information" }); | ||
} | ||
|
||
console.log('Registering'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
console.log('Registering'); |
|
||
console.log('Registering'); | ||
|
||
req.body.password = await bcrypt.hash(password, saltRounds).then(hash => hash); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For this .then(hash => hash);
if you are just returning what you are getting, do you even need it?
@KingAtoki