Skip to content

Delete feedback#634

Merged
loiswells97 merged 9 commits intomainfrom
lois/948-delete-feedback
Dec 5, 2025
Merged

Delete feedback#634
loiswells97 merged 9 commits intomainfrom
lois/948-delete-feedback

Conversation

@loiswells97
Copy link
Copy Markdown
Contributor

@loiswells97 loiswells97 commented Nov 28, 2025

Status

What's changed?

  • Added route to allow users to delete feedback
  • Owners can read and delete any feedback within the school
  • Teachers can only delete feedback for projects within their class

@cla-bot cla-bot Bot added the cla-signed label Nov 28, 2025
Comment thread lib/concepts/feedback/delete.rb Dismissed
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR implements the ability for teachers and school owners to delete feedback on student projects. The implementation adds a DELETE endpoint to the feedback API, updates authorization rules in CanCanCan, and includes comprehensive test coverage for different user roles.

Key Changes

  • Added destroy action to the Feedback API that allows authorized users to delete feedback
  • Updated authorization rules to permit school owners to delete any feedback in their school and teachers to delete feedback for projects in their classes
  • Created a new Feedback::Delete operation following the repository's domain operation pattern

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
config/routes.rb Added destroy to the feedback resources to expose the DELETE endpoint
app/controllers/api/feedback_controller.rb Implemented destroy action that calls the Delete operation and returns appropriate status codes
app/models/ability.rb Added :destroy permission for school owners (all school feedback) and teachers (class projects)
lib/concepts/feedback/delete.rb Created Delete operation with error handling and Sentry integration
spec/models/ability_spec.rb Added authorization tests verifying destroy permissions for different roles
spec/features/feedback/deleting_feedback_spec.rb Added feature tests for successful deletion, forbidden access, and non-existent feedback scenarios
spec/concepts/feedback/delete_spec.rb Added unit tests for the Delete operation covering success and failure cases

Comment thread spec/concepts/feedback/delete_spec.rb
Comment thread spec/concepts/feedback/delete_spec.rb Outdated
Comment thread app/controllers/api/feedback_controller.rb
Comment thread lib/concepts/feedback/delete.rb
Comment thread spec/features/feedback/deleting_feedback_spec.rb Outdated
Copy link
Copy Markdown
Contributor

@jamiebenstead jamiebenstead left a comment

Choose a reason for hiding this comment

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

LGTM

@loiswells97 loiswells97 merged commit 1064458 into main Dec 5, 2025
6 checks passed
@loiswells97 loiswells97 deleted the lois/948-delete-feedback branch December 5, 2025 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants