From 793360ef7d559c2dab19482bc56d5573bce23ec2 Mon Sep 17 00:00:00 2001 From: Liam Moynihan Date: Fri, 19 Mar 2021 09:53:31 -0400 Subject: [PATCH] Changes to make frontend compatable with backend scaffold email verification --- src/App.tsx | 5 +++++ src/containers/signup/index.tsx | 19 +++++++++---------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index b3b0948..5e6485c 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -67,6 +67,11 @@ const App: React.FC = () => { exact component={Settings} /> + ); diff --git a/src/containers/signup/index.tsx b/src/containers/signup/index.tsx index 8716581..ecc4919 100644 --- a/src/containers/signup/index.tsx +++ b/src/containers/signup/index.tsx @@ -19,12 +19,19 @@ const { Title, Paragraph } = Typography; type SignupProps = UserAuthenticationReducerState; +interface SignupFormData extends SignupRequest { + confirmPassword: string; +} + const Signup: React.FC = ({ tokens }) => { const dispatch = useDispatch(); const history = useHistory(); - const onFinish = (values: SignupRequest) => { - dispatch(signup(values)); + const onFinish = (values: SignupFormData) => { + // confirmPassword is checked in the form but should not be sent in the request + // eslint-disable-next-line @typescript-eslint/no-unused-vars + const { confirmPassword, ...request } = values; + dispatch(signup(request)); }; if (getPrivilegeLevel(tokens) !== PrivilegeLevel.NONE) { @@ -64,14 +71,6 @@ const Signup: React.FC = ({ tokens }) => { - - - -