-
Notifications
You must be signed in to change notification settings - Fork 18
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
adding feature of user search #35
Conversation
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.
This is looking pretty good. Maybe add in some unit test, or you can just manually test it somehow yourself.
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.
Please read the comments.
The model is not being used, which I think it should be.
The model is for managing the data and logic.
The controller is for managing the communication between the model and the view, so it formats input data from each into commands that can be accepted by the other. It is where we would ensure the application is not vulnerable to an SQL-i attack, for example.
…to user_search
I will help fix this soon |
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.
I have left some suggestions.
It is not a good idea to rely on data being manually entered in the database for the tests to pass.
what i was thinking is that I manually inserted some data into the databbase and try if i can search those data by id, and I also try to search some data which does not exist. So what else could I do in order to test the function? |
The problem with that is new changes have all collection data in the test database wiped before each test and only the test database is used for tests. |
sending back json/user id after user is created
sending back json/user id after user is created
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.
Sorry for the delay. LGTM!
Description
Adding three functions for user search by id/name/username using mongoose.
Related Issue
Solves #20
Type of change
How Has This Been Tested?
This schema has not been tested.
Checklist:
For more information, refer to the Contributing Guidelines document.