crud-001-new#9
Conversation
|
added new code |
|
updated ignore file |
waleedwaseem
left a comment
There was a problem hiding this comment.
@bilalAhmad69 - Few changes. Good feedback integration!
| "port": 4000, | ||
| "db": { | ||
| "username": "root", | ||
| "password": null, | ||
| "password": "12345678", | ||
| "name": "productbox", | ||
| "host": "127.0.0.1" | ||
| }, |
| {} | ||
| ); | ||
| User.associate = function (models) { | ||
| console.log("🚀 ~ file: user.js:37 ~ models", models); |
There was a problem hiding this comment.
What is the purpose of this?
There was a problem hiding this comment.
make the relation between tables. sequelize used associate function. but there is not need of this function. i forget it to remove.
| data: user.email, | ||
| }); | ||
| } catch (err) { | ||
| next(err); |
There was a problem hiding this comment.
next always take it to the next function, can you explain where is the next leading to in this case?
There was a problem hiding this comment.
the function(middleware) is located in app.js . when ever we pass the err obj to next function it take to the error handler function.
| .tern-port | ||
|
|
||
| # development.josn file | ||
| .config/environments/development.json |
There was a problem hiding this comment.
| .config/environments/development.json | |
| .config/environments/ |
|
@bilalAhmad69 - Good work, please review the feedback. Also fix linting. |
| email: { | ||
| allowNull: false, | ||
| type: Sequelize.STRING, | ||
| }, |
There was a problem hiding this comment.
@bilalAhmad69 - make it unique within this migration.
| password: { | ||
| type: Sequelize.STRING, | ||
| allowNull: false, | ||
| }, |
refine code .. correct naming convention , adding archive column to user table