2015-12-21 17:51:49 +01:00
|
|
|
class API::V1::ProceduresController < APIController
|
2018-03-16 10:10:43 +01:00
|
|
|
resource_description do
|
|
|
|
description AUTHENTICATION_TOKEN_DESCRIPTION
|
|
|
|
end
|
|
|
|
|
2016-02-22 19:42:47 +01:00
|
|
|
api :GET, '/procedures/:id', 'Informations concernant une procédure'
|
|
|
|
param :id, Integer, desc: "L'identifiant de la procédure", required: true
|
|
|
|
error code: 401, desc: "Non authorisé"
|
|
|
|
error code: 404, desc: "Procédure inconnue"
|
|
|
|
|
2016-02-02 18:11:44 +01:00
|
|
|
def show
|
2018-03-15 18:07:20 +01:00
|
|
|
procedure = administrateur.procedures.find(params[:id]).decorate
|
2015-12-21 17:51:49 +01:00
|
|
|
|
2018-01-16 13:34:24 +01:00
|
|
|
render json: { procedure: ProcedureSerializer.new(procedure).as_json }
|
2015-12-21 17:51:49 +01:00
|
|
|
rescue ActiveRecord::RecordNotFound => e
|
|
|
|
Rails.logger.error(e.message)
|
|
|
|
render json: {}, status: 404
|
|
|
|
end
|
|
|
|
end
|