mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: Support searching custom staff actions (#7346)
This commit is contained in:
@@ -6,7 +6,7 @@ class Admin::StaffActionLogsController < Admin::AdminController
|
||||
staff_action_logs = UserHistory.staff_action_records(current_user, filters).to_a
|
||||
render json: StaffActionLogsSerializer.new({
|
||||
staff_action_logs: staff_action_logs,
|
||||
user_history_actions: UserHistory.staff_actions.sort.map { |name| { id: UserHistory.actions[name], name: name } }
|
||||
user_history_actions: staff_available_actions
|
||||
}, root: false)
|
||||
end
|
||||
|
||||
@@ -77,4 +77,14 @@ class Admin::StaffActionLogsController < Admin::AdminController
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def staff_available_actions
|
||||
UserHistory.staff_actions.sort.map do |name|
|
||||
{
|
||||
id: name,
|
||||
action_id: UserHistory.actions[name] || UserHistory.actions[:custom_staff],
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user