From 778cf90f8556dbde4888847f1c2ef1a027ddbd8b Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sun, 21 Aug 2022 04:05:10 +0200 Subject: [PATCH] Add `Moderation::QuestionsController` --- app/controllers/moderation/questions_controller.rb | 9 +++++++++ config/routes.rb | 1 + 2 files changed, 10 insertions(+) create mode 100644 app/controllers/moderation/questions_controller.rb diff --git a/app/controllers/moderation/questions_controller.rb b/app/controllers/moderation/questions_controller.rb new file mode 100644 index 00000000..7b9aa219 --- /dev/null +++ b/app/controllers/moderation/questions_controller.rb @@ -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 diff --git a/config/routes.rb b/config/routes.rb index 4d5ae874..49ac0b66 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -26,6 +26,7 @@ Rails.application.routes.draw do 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/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 post "/mod/destroy_report", to: "moderation#destroy_report", as: :mod_destroy_report post "/mod/privilege", to: "moderation#privilege", as: :mod_privilege