diff options
Diffstat (limited to 'src/pages/AuthPage/SignUpForm.tsx')
-rw-r--r-- | src/pages/AuthPage/SignUpForm.tsx | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/pages/AuthPage/SignUpForm.tsx b/src/pages/AuthPage/SignUpForm.tsx index 2769eb0..0e3d0c7 100644 --- a/src/pages/AuthPage/SignUpForm.tsx +++ b/src/pages/AuthPage/SignUpForm.tsx @@ -31,12 +31,11 @@ const SignUpForm: React.FC<PropTypes> = ({ logIn }) => { const inputRefPassword = useRef<HTMLInputElement>(); const onClick = () => { - const name = inputRef.current?.value; + const username = inputRef.current?.value; const password = inputRefPassword.current?.value; - const newUser = { name, password }; - if (name && password) { - post('/users', newUser).then(() => { - logIn(name, password); + if (username && password) { + post('/users', { username, password }).then(() => { + logIn(username, password); }); } }; |