2015-12-21 17:51:49 +01:00
|
|
|
class API::V1::ProceduresController < APIController
|
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
|
2016-02-26 14:16:17 +01:00
|
|
|
param :token, String, desc: "Token administrateur", required: true
|
2016-02-22 19:42:47 +01:00
|
|
|
error code: 401, desc: "Non authorisé"
|
|
|
|
error code: 404, desc: "Procédure inconnue"
|
|
|
|
|
|
|
|
description <<-EOS
|
|
|
|
Plop
|
|
|
|
EOS
|
|
|
|
|
|
|
|
meta champs: {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2016-02-02 18:11:44 +01:00
|
|
|
def show
|
2015-12-21 17:51:49 +01:00
|
|
|
@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
|
2016-02-22 17:53:00 +01:00
|
|
|
|
2015-12-21 17:51:49 +01:00
|
|
|
end
|