Merge pull request #8713 from tchak/fix-graphql-as_degraded_mode
fix(graphql): fix etablissement as_degraded_mode?
This commit is contained in:
commit
ad98f2508b
1 changed files with 4 additions and 1 deletions
|
@ -6,7 +6,10 @@ module Types::Champs
|
|||
|
||||
def etablissement
|
||||
if object.etablissement_id.present?
|
||||
Loaders::Record.for(Etablissement).load(object.etablissement_id)
|
||||
Loaders::Record.for(Etablissement).load(object.etablissement_id).then do |etablissement|
|
||||
return nil if etablissement.as_degraded_mode?
|
||||
etablissement
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue