[GraphQL] hide dossiers brouillon from api

This commit is contained in:
Paul Chavard 2020-12-17 18:03:35 +01:00
parent 588233d7ec
commit 7a8b1fa639

View file

@ -19,7 +19,7 @@ module Types
end
def dossier(number:)
Dossier.for_api_v2.find(number)
Dossier.state_not_brouillon.for_api_v2.find(number)
rescue => e
raise GraphQL::ExecutionError.new(e.message, extensions: { code: :not_found })
end