X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/0e21afc56593eb9fce14d8cfe0984494e758c150..71654e563ebe04856b931a7ad62a2f4bf2a04c65:/app/controllers/api/user_blocks_controller.rb?ds=sidebyside diff --git a/app/controllers/api/user_blocks_controller.rb b/app/controllers/api/user_blocks_controller.rb new file mode 100644 index 000000000..19fd4b400 --- /dev/null +++ b/app/controllers/api/user_blocks_controller.rb @@ -0,0 +1,18 @@ +module Api + class UserBlocksController < ApiController + before_action :check_api_readable + + 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