demarches-normaliennes/app/controllers/api/v1/procedures_controller.rb
2016-02-18 18:02:07 +01:00

22 lines
614 B
Ruby

class API::V1::ProceduresController < APIController
swagger_controller :procedures, "Procédures"
swagger_api :show do
summary "Récupérer la liste de ses procédures."
param :path, :id, :integer, "Procédure ID"
param :query, :token, :integer, "Admin TOKEN"
response :ok, "Success", :Procedure
response :unauthorized
response :not_found
end
def show
@procedure = current_administrateur.procedures.find(params[:id]).decorate
render json: @procedure
rescue ActiveRecord::RecordNotFound => e
Rails.logger.error(e.message)
render json: {}, status: 404
end
end