Remove leftovers from PR #117; exercise feedback on RfC show

This commit is contained in:
Sebastian Serth
2020-10-20 12:15:45 +02:00
parent d25dd41ccf
commit 9ddeb91c41
4 changed files with 2 additions and 21 deletions

View File

@ -111,20 +111,6 @@ class RequestForCommentsController < ApplicationController
authorize!
end
def create_comment_exercise
old = UserExerciseFeedback.find_by(exercise_id: params[:exercise_id], user_id: current_user.id, user_type: current_user.class.name)
if old
old.delete
end
uef = UserExerciseFeedback.new(comment_params)
if uef.save
render(json: {success: "true"})
else
render(json: {success: "false"})
end
end
# DELETE /request_for_comments/1
# DELETE /request_for_comments/1.json
def destroy
@ -148,8 +134,4 @@ class RequestForCommentsController < ApplicationController
params.require(:request_for_comment).permit(:exercise_id, :file_id, :question, :requested_at, :solved, :submission_id).merge(user_id: current_user.id, user_type: current_user.class.name)
end
def comment_params
params.permit(:exercise_id, :feedback_text).merge(user_id: current_user.id, user_type: current_user.class.name)
end
end