-
Notifications
You must be signed in to change notification settings - Fork 3
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
Backend (users, ratings) #2
base: main
Are you sure you want to change the base?
Conversation
backend/src/routes/ratings.js
Outdated
|
||
router.get('/', async(req, res) => { | ||
try{ | ||
const ratings = await Rating.find() |
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.
Separate the controller and service logic.
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.
Name the route files as ratings.routes.js
backend/src/routes/users.js
Outdated
|
||
|
||
router.get('/', async(req, res) => { | ||
try{ |
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.
Same for this, Make a different controller and service
backend/src/routes/ratings.js
Outdated
|
||
|
||
router.get('/', async(req, res) => { | ||
try{ |
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.
Create an index.js file in routes to map routes
@Apoorvgarg-creator I have made the required changes, please review. |
@navyagarwal Let's have a meet later. I reviewed your changes but couldn't find the the service and controller logic separated. I will show you to do for one and also explain it you. But Good Work on PR ! Merging it for now but we will look into a different pattern |
Created model and (get, put, patch, delete) routes for:
- name
- email
- if management
- date
- user_id
- food_id
- stars
- tags
Improvements needed: