fix(graphql): hide deleted dossiers

This commit is contained in:
Paul Chavard 2022-03-30 17:22:39 +02:00
parent c2812a7633
commit 5bafc91220
2 changed files with 8 additions and 2 deletions

View file

@ -72,7 +72,10 @@ module Types
end
def dossiers(updated_since: nil, created_since: nil, state: nil, archived: nil, revision: nil, max_revision: nil, min_revision: nil, order:)
dossiers = object.dossiers.state_not_brouillon.for_api_v2
dossiers = object
.dossiers
.visible_by_administration
.for_api_v2
if state.present?
dossiers = dossiers.where(state: state)

View file

@ -10,7 +10,10 @@ module Types
end
def dossiers(updated_since: nil, created_since: nil, state: nil, order:)
dossiers = object.dossiers.state_not_brouillon.for_api_v2
dossiers = object
.dossiers
.visible_by_administration
.for_api_v2
if state.present?
dossiers = dossiers.where(state: state)