Add `Moderation::QuestionsController`

This commit is contained in:
Andreas Nedbal 2022-08-21 04:05:10 +02:00 committed by Andreas Nedbal
parent 6f19d806f7
commit 778cf90f85
2 changed files with 10 additions and 0 deletions

View File

@ -0,0 +1,9 @@
# frozen_string_literal: true
class Moderation::QuestionsController < ApplicationController
before_action :authenticate_user!
def index
@questions = Question.where(author_identifier: params[:author_identifier])
end
end

View File

@ -26,6 +26,7 @@ Rails.application.routes.draw do
get "/moderation/blocks", to: "moderation/anonymous_block#index", as: :mod_anon_block_index get "/moderation/blocks", to: "moderation/anonymous_block#index", as: :mod_anon_block_index
get "/moderation/reports(/:type)", to: "moderation/reports#index", as: :moderation_reports, defaults: { type: "all" } get "/moderation/reports(/:type)", to: "moderation/reports#index", as: :moderation_reports, defaults: { type: "all" }
get "/moderation/inbox/:user", to: "moderation/inbox#index", as: :mod_inbox_index get "/moderation/inbox/:user", to: "moderation/inbox#index", as: :mod_inbox_index
get "/moderation/questions/:author_identifier", to: "moderation/questions#index", as: :moderation_questions
namespace :ajax do namespace :ajax do
post "/mod/destroy_report", to: "moderation#destroy_report", as: :mod_destroy_report post "/mod/destroy_report", to: "moderation#destroy_report", as: :mod_destroy_report
post "/mod/privilege", to: "moderation#privilege", as: :mod_privilege post "/mod/privilege", to: "moderation#privilege", as: :mod_privilege