openstreetmap-website/app/controllers/api/user_blocks_controller.rb
Andy Allan c1cccd40fc Move check_api_readable to api_controller
It's easier to skip the check in the two places that we need to, and
include it by default everywhere else.
2024-05-29 14:54:16 +01:00

16 lines
405 B
Ruby

module Api
class UserBlocksController < ApiController
authorize_resource
around_action :api_call_handle_error, :api_call_timeout
before_action :set_request_formats
def show
raise OSM::APIBadUserInput, "No id was given" unless params[:id]
@user_block = UserBlock.find(params[:id])
rescue ActiveRecord::RecordNotFound
raise OSM::APINotFoundError
end
end
end