Allow admins and teachers to remove explicit RfC text

This commit is contained in:
Sebastian Serth
2022-04-28 15:31:58 +02:00
parent e9efb5bc2b
commit 9a0f26a84f
4 changed files with 14 additions and 1 deletions

View File

@ -1,8 +1,9 @@
# frozen_string_literal: true
class RequestForCommentsController < ApplicationController
include CommonBehavior
before_action :require_user!
before_action :set_request_for_comment, only: %i[show mark_as_solved set_thank_you_note]
before_action :set_request_for_comment, only: %i[show mark_as_solved set_thank_you_note clear_question]
before_action :set_study_group_grouping,
only: %i[index my_comment_requests rfcs_with_my_comments rfcs_for_exercise]
@ -101,6 +102,12 @@ class RequestForCommentsController < ApplicationController
end
end
# POST /request_for_comments/1/clear_question
def clear_question
authorize!
update_and_respond(object: @request_for_comment, params: {question: nil})
end
# GET /request_for_comments/1
# GET /request_for_comments/1.json
def show