fix(graphql): hide deleted dossiers
This commit is contained in:
parent
c2812a7633
commit
5bafc91220
2 changed files with 8 additions and 2 deletions
|
@ -72,7 +72,10 @@ module Types
|
||||||
end
|
end
|
||||||
|
|
||||||
def dossiers(updated_since: nil, created_since: nil, state: nil, archived: nil, revision: nil, max_revision: nil, min_revision: nil, order:)
|
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?
|
if state.present?
|
||||||
dossiers = dossiers.where(state: state)
|
dossiers = dossiers.where(state: state)
|
||||||
|
|
|
@ -10,7 +10,10 @@ module Types
|
||||||
end
|
end
|
||||||
|
|
||||||
def dossiers(updated_since: nil, created_since: nil, state: nil, order:)
|
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?
|
if state.present?
|
||||||
dossiers = dossiers.where(state: state)
|
dossiers = dossiers.where(state: state)
|
||||||
|
|
Loading…
Reference in a new issue