don't clean the rna champ value

Cleaning the value is useless, when fetching the association,
as the value will be re-written by the dossier update, when the user
fills in the dossier.

Furthermore we need the value to persist when prefilling the champ.
This commit is contained in:
sebastiencarceles 2023-01-13 14:52:16 +01:00
parent 7e55aca107
commit 33fa40eda2
3 changed files with 13 additions and 17 deletions

View file

@ -6,7 +6,9 @@ module RNAChampAssociationFetchableConcern
update!(data: data, value: rna)
nil
rescue APIEntreprise::API::Error, ActiveRecord::RecordInvalid => error
update(data: nil, value: nil)
self.data = nil
self.value = rna
save(validate: false)
if error.try(:network_error?) && !APIEntrepriseService.api_up?
:network_error
else