fix(api): hide deleted dossiers

This commit is contained in:
Paul Chavard 2022-03-30 17:21:31 +02:00
parent a171ebb772
commit c2812a7633

View file

@ -53,7 +53,10 @@ class API::V1::DossiersController < APIController
end end
order = ORDER_DIRECTIONS.fetch(params[:order], :asc) order = ORDER_DIRECTIONS.fetch(params[:order], :asc)
@dossiers = @procedure.dossiers.state_not_brouillon.order_by_created_at(order) @dossiers = @procedure
.dossiers
.visible_by_administration
.order_by_created_at(order)
rescue ActiveRecord::RecordNotFound rescue ActiveRecord::RecordNotFound
render json: {}, status: :not_found render json: {}, status: :not_found