Skip to content

Implement blog API and refactor user data handling#6

Merged
hussein-m-kandil merged 14 commits intomainfrom
dev
May 15, 2025
Merged

Implement blog API and refactor user data handling#6
hussein-m-kandil merged 14 commits intomainfrom
dev

Conversation

@hussein-m-kandil
Copy link
Copy Markdown
Owner

This pull request introduces core blog API features and includes various refactors across the codebase to improve modularity, clarity, and security.

What’s New

  • 🧱 Added Prisma models for posts, post comments, and voting behavior.
  • ✍️ Implemented CRUD routes for posts and their comments.
  • 📄 Added routes to retrieve user posts, comments, and votes.
  • 🧼 Refactored users route logic to conform to the new changes.

Enhancements

  • 🔒 Globally omitted sensitive fields (e.g., passwords) from user data in API responses.
  • 🧩 Extracted and reused filtering logic across different route handlers.
  • 🔄 Used a centralized helper to handle all known Prisma DB errors.
  • 🔍 Added middleware for optional authentication validation, improving route flexibility.
  • 🧪 Refactored integration and manual testing setups for REST API.

Fixes

  • 🛠️ Respond with a 404 on a delete user request if it is not found.
  • ⚠️ Suppressed irrelevant warnings during DB push in test setup.

@hussein-m-kandil hussein-m-kandil merged commit 013732b into main May 15, 2025
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.

1 participant