Skip to content

Conversation

@GiGwebs
Copy link
Contributor

@GiGwebs GiGwebs commented Dec 17, 2024

  • Add GameDetailsApiController for handling review operations
  • Implement client-side JavaScript for dynamic updates
  • Add proper error handling and user feedback
  • Update UI with dropdown rating selection

✨ Description

AJAX Implementation for Game Reviews

This PR implements AJAX functionality for the game reviews section to enhance user experience by enabling dynamic updates without page reloads.

Changes Made

Backend Changes

  • Added GameDetailsApiController with endpoints for:
    • GET /api/games/{id}/reviews to fetch reviews
    • POST /api/games/{id}/reviews to submit reviews
  • Implemented automatic average rating calculation
  • Added proper error handling and validation

Frontend Changes

  • Created gameDetails.js for client-side functionality:
    • Dynamic review submission
    • Real-time UI updates
    • Loading states and error handling
  • Updated review form with dropdown rating selection (1-5 stars)
  • Added success/error alert messages for user feedback

UI/UX Improvements

  • Reviews now submit without page reload
  • Star ratings update dynamically
  • Immediate feedback on submission success/failure
  • Smooth transitions and loading states

Testing Done

  • Tested review submission with different ratings
  • Verified average rating updates
  • Confirmed error handling works as expected
  • Tested user feedback mechanisms

Please review and provide feedback. Thank you!

Linked Issue:

🔄 Type of Change

  • 🐞 Bug fix
  • ✨ New feature
  • 🔧 Improvement

✅ Checklist

  • 📝 Code follows project style guidelines
  • 🔗 Relevant issue is linked and moved to 'In Progress'
  • 🧪 All relevant tests have been added or updated
  • ✔️ Continuous integration (CI) tests have passed
  • 👀 Ready for review

📄 Additional Information

- Add GameDetailsApiController for handling review operations
- Implement client-side JavaScript for dynamic updates
- Add proper error handling and user feedback
- Update UI with dropdown rating selection
@RespectMathias
Copy link
Contributor

Your DetailsModel is already a GameDetailsApiController.
This is ASP.NET razor pages, not ASP.NET MVC

Both are mvc but structure it vastly different.

@GiGwebs
Copy link
Contributor Author

GiGwebs commented Dec 17, 2024 via email

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.

3 participants