Skip to content
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

dishes controller, swagger and tests added. #92

Merged
merged 3 commits into from
Aug 10, 2023

Conversation

cansucreates
Copy link
Collaborator

No description provided.

@cansucreates cansucreates linked an issue Aug 9, 2023 that may be closed by this pull request
@cansucreates cansucreates self-assigned this Aug 9, 2023
Copy link
Collaborator

@abdurrahmanabzd abdurrahmanabzd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job, I love what you did with the dishes controller!

I'm pretty sure that took a lot of effort. I really appreciate your hard work.

There're a few things I want to bring your attention to, in your getDishesByLocation function, you're searching for dishes with user_id.address.city but there's no user_id given to the function.
const dishes = await Dishes.find({ 'user_id.address.city': city, 'user_id.address.country': country,});
You had the part where it gets the user_id with the same location and maps out the dishes of these users before your last commit, in lines 80 to 89.
Also, I believe you should look for the users who also have the role "cook" instead of pulling the data of all users. Imagine if we were looking for dishes in Istanbul, you would pull the data of millions of people! while there might be only hundreds or a couple thousands of cooks.

Copy link
Collaborator

@abdurrahmanabzd abdurrahmanabzd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tried to fix the bug...

@cansucreates cansucreates merged commit 7ca2cca into main Aug 10, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fix-dishes-final-commit
3 participants