2015-12-21 17:51:49 +01:00
|
|
|
class API::V1::ProceduresController < APIController
|
2023-09-20 09:31:14 +02:00
|
|
|
before_action :check_api_token
|
|
|
|
before_action :fetch_procedure
|
2018-09-26 16:38:35 +02:00
|
|
|
|
2016-02-02 18:11:44 +01:00
|
|
|
def show
|
2018-10-22 19:24:38 +02:00
|
|
|
render json: { procedure: ProcedureSerializer.new(@procedure).as_json }
|
2018-09-26 16:38:35 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
2023-09-20 09:31:14 +02:00
|
|
|
def fetch_procedure
|
|
|
|
@procedure = @api_token.procedures.for_api.find(params[:id])
|
2018-09-26 16:38:35 +02:00
|
|
|
|
2018-09-26 16:39:10 +02:00
|
|
|
rescue ActiveRecord::RecordNotFound
|
2018-09-26 16:38:35 +02:00
|
|
|
render json: {}, status: :not_found
|
2015-12-21 17:51:49 +01:00
|
|
|
end
|
|
|
|
end
|