Merge pull request #5817 from tchak/stop-dossiers-brouillon-leak

[GraphQL] hide dossiers brouillon from api
This commit is contained in:
Paul Chavard 2020-12-18 16:50:16 +01:00 committed by GitHub
commit e63f93f8de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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