Skip to content

Conversation

@DiyaGhorpade
Copy link

…and error handling, clean up code, destructure req.body, and sort food list by creation date

📌 Pull Request Summary

Fixes
1.Added validation for required fields in addFood and removeFood.
2.Used optional chaining for uploaded images to prevent crashes.
3.Checked existence of food items before deletion.
4.Safely deleted associated image files using fs and path.
5.Sorted food items by creation date in getFoodByRestaurant.
6.Cleaned up destructuring and removed redundant code/parentheses.

🛠️ Type of Change

Please select options that are relevant to your pull request

  • 🧹 Code refactor
  • 🚀 Performance improvement

🔗 Related Issue

Closes #786

✅ Checklist

Please confirm the following before submitting:

  • I have tested my changes locally
  • I have run npm run dev or similar to check code style
  • I have updated documentation (if necessary)
  • My code follows the project’s coding conventions
  • I have merged the latest main or dev branch
  • I have performed a self-review of my own code.
  • My changes generate no new warnings or errors.
  • I have commented my code, especially in hard-to-understand areas
  • I have linked the related issue

📸 Screenshots (if applicable)

  • Add before/after screenshots or UI changes.

🧠 Additional Notes

  • Anything else you want the reviewer to know.

…and error handling

clean up code, destructure req.body, and sort food list by creation date
@vercel
Copy link

vercel bot commented Oct 18, 2025

@DiyaGhorpade is attempting to deploy a commit to the Abhi's projects Team on Vercel.

A member of the Team first needs to authorize it.

@DiyaGhorpade
Copy link
Author

@Abhishek2634 is it possible to get a level-2 or level-3 label for GSSOC'25 as this PR focuses on backend restructuring?

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.

Improve foodController.js code quality

1 participant