mirror of
https://github.com/discourse/discourse.git
synced 2024-12-14 10:53:40 +08:00
586454bcf1
* DEV: Add a dedicated Admin::StaffController base controller The current parent(Admin:AdminController) for all admin-related controllers uses a filter that allows only staff(admin, moderator) users. This refactor makes Admin::AdminController filter for only admins as the name suggests and introduces a base controller dedicated for staff-related endpoints. * DEV: Set staff-only controllers parent to Admin::StaffController Refactor staff-only controllers to inherit newly introduced Admin::StaffController abstract controller. This conveys the purpose of the parent controller better unlike the previously used parent controller.
11 lines
381 B
Ruby
11 lines
381 B
Ruby
# frozen_string_literal: true
|
|
|
|
class Admin::ScreenedUrlsController < Admin::StaffController
|
|
|
|
def index
|
|
screened_urls = ScreenedUrl.select("domain, sum(match_count) as match_count, max(last_match_at) as last_match_at, min(created_at) as created_at").group(:domain).order('last_match_at DESC').to_a
|
|
render_serialized(screened_urls, GroupedScreenedUrlSerializer)
|
|
end
|
|
|
|
end
|