From a05169fa3cb3b17e45ec92652d101a086d15a0b1 Mon Sep 17 00:00:00 2001 From: marta197 Date: Tue, 15 Oct 2024 12:38:35 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20update=20link=20member=20when=20?= =?UTF-8?q?member=20is=20not=20mandatory=20and=20become=20member?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Joana Figueira --- src/containers/HolderChange/BecomeMember.jsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/containers/HolderChange/BecomeMember.jsx b/src/containers/HolderChange/BecomeMember.jsx index 2a7fd572..51b2b30e 100644 --- a/src/containers/HolderChange/BecomeMember.jsx +++ b/src/containers/HolderChange/BecomeMember.jsx @@ -20,9 +20,12 @@ function BecomeMember(props) { setFieldValue('member', { ...values.member, become_member: option, - link_member: isMemberMandatoryForHolderchange + // When become member is true, link member must be false. + // When member is not mandatory for holderchange, we set the link member to undefined + // because it is set in another page. + link_member: isMemberMandatoryForHolderchange || option === true ? !option - : values.member.link_member + : undefined }) }