clean: log current_user in api v1
This commit is contained in:
parent
c0ca9f156e
commit
7a6658700e
2 changed files with 15 additions and 8 deletions
|
@ -48,14 +48,18 @@ class API::V1::DossiersController < APIController
|
|||
administrateur = find_administrateur_for_token(@procedure)
|
||||
if administrateur.nil?
|
||||
render json: {}, status: :unauthorized
|
||||
else
|
||||
# allow BaseController append_info_to_payload
|
||||
# to log info on current_user
|
||||
@current_user = administrateur.user
|
||||
|
||||
order = ORDER_DIRECTIONS.fetch(params[:order], :asc)
|
||||
@dossiers = @procedure
|
||||
.dossiers
|
||||
.visible_by_administration
|
||||
.order_by_created_at(order)
|
||||
|
||||
end
|
||||
|
||||
order = ORDER_DIRECTIONS.fetch(params[:order], :asc)
|
||||
@dossiers = @procedure
|
||||
.dossiers
|
||||
.visible_by_administration
|
||||
.order_by_created_at(order)
|
||||
|
||||
rescue ActiveRecord::RecordNotFound
|
||||
render json: {}, status: :not_found
|
||||
end
|
||||
|
|
|
@ -13,8 +13,11 @@ class API::V1::ProceduresController < APIController
|
|||
administrateur = find_administrateur_for_token(@procedure)
|
||||
if administrateur.nil?
|
||||
render json: {}, status: :unauthorized
|
||||
else
|
||||
# allow BaseController append_info_to_payload
|
||||
# to log info on current_user
|
||||
@current_user = administrateur.user
|
||||
end
|
||||
|
||||
rescue ActiveRecord::RecordNotFound
|
||||
render json: {}, status: :not_found
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue