mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 16:11:08 +08:00
A form to add ip addresses to be blocked or whitelisted
This commit is contained in:
@ -7,6 +7,15 @@ class Admin::ScreenedIpAddressesController < Admin::AdminController
|
||||
render_serialized(screened_ip_addresses, ScreenedIpAddressSerializer)
|
||||
end
|
||||
|
||||
def create
|
||||
screened_ip_address = ScreenedIpAddress.new(allowed_params)
|
||||
if screened_ip_address.save
|
||||
render_serialized(screened_ip_address, ScreenedIpAddressSerializer)
|
||||
else
|
||||
render_json_error(screened_ip_address)
|
||||
end
|
||||
end
|
||||
|
||||
def update
|
||||
if @screened_ip_address.update_attributes(allowed_params)
|
||||
render json: success_json
|
||||
|
Reference in New Issue
Block a user