fix(usecase): fix persona skippable but still send user contact

This commit is contained in:
ronronscelestes 2022-02-10 14:16:00 +01:00
parent 22a9818eb2
commit a72c1c0c3b

View File

@ -56,7 +56,7 @@ const UsecasePage = () => {
} }
}, [isComingFromRegister, push]); }, [isComingFromRegister, push]);
const handleSubmit = skip => { const handleSubmit = skipPersona => {
try { try {
const { const {
state: { email, firstAdmin, firstname }, state: { email, firstAdmin, firstname },
@ -69,8 +69,8 @@ const UsecasePage = () => {
email, email,
username: firstname, username: firstname,
firstAdmin, firstAdmin,
persona: skip ? undefined : persona, persona: skipPersona ? undefined : persona,
personaOther: skip ? undefined : personaOther, personaOther: skipPersona ? undefined : personaOther,
}, },
cancelToken: source.token, cancelToken: source.token,
}); });
@ -96,7 +96,7 @@ const UsecasePage = () => {
<UnauthenticatedLayout> <UnauthenticatedLayout>
<Main> <Main>
<LayoutContent> <LayoutContent>
<form onSubmit={handleSubmit}> <form onSubmit={() => handleSubmit(false)}>
<Flex direction="column" paddingBottom={7}> <Flex direction="column" paddingBottom={7}>
<Logo /> <Logo />
<Box paddingTop={6} paddingBottom={1} width={pxToRem(250)}> <Box paddingTop={6} paddingBottom={1} width={pxToRem(250)}>
@ -144,7 +144,7 @@ const UsecasePage = () => {
</LayoutContent> </LayoutContent>
<Flex justifyContent="center"> <Flex justifyContent="center">
<Box paddingTop={4}> <Box paddingTop={4}>
<TextButton onClick={() => handleSubmit('skip')}> <TextButton onClick={() => handleSubmit(true)}>
{formatMessage({ {formatMessage({
id: 'Usecase.button.skip', id: 'Usecase.button.skip',
defaultMessage: 'Skip this question', defaultMessage: 'Skip this question',