Remove vote functionality from `Ajax::ModerationController`

This commit is contained in:
Andreas Nedbal 2022-07-18 22:29:24 +02:00 committed by Karina Kwiatek
parent 4ab391a09e
commit 43af4acb2c
1 changed files with 0 additions and 41 deletions

View File

@ -3,47 +3,6 @@ require 'use_case/user/unban'
require 'errors' require 'errors'
class Ajax::ModerationController < AjaxController class Ajax::ModerationController < AjaxController
def vote
params.require :id
params.require :upvote
report = Report.find(params[:id])
begin
current_user.report_vote(report, params[:upvote])
rescue => e
Sentry.capture_exception(e)
@response[:status] = :fail
@response[:message] = t(".error")
return
end
@response[:count] = report.votes
@response[:status] = :okay
@response[:message] = t(".success")
@response[:success] = true
end
def destroy_vote
params.require :id
report = Report.find(params[:id])
begin
current_user.report_unvote report
rescue => e
Sentry.capture_exception(e)
@response[:status] = :fail
@response[:message] = t(".error")
return
end
@response[:count] = report.votes
@response[:status] = :okay
@response[:message] = t(".success")
@response[:success] = true
end
def destroy_report def destroy_report
params.require :id params.require :id