aboutsummaryrefslogtreecommitdiff
path: root/src/pages/AuthPage
diff options
context:
space:
mode:
authorEugene Sokolov <eug-vs@keemail.me>2020-06-25 14:41:14 +0300
committerGitHub <noreply@github.com>2020-06-25 14:41:14 +0300
commit9dfc98d5014f91afb45ad4eebbe9f0f704ddfdf5 (patch)
treeb5a47cce16b224dd74625db72f721e5e797a1611 /src/pages/AuthPage
parent190916329611704b1035158363302f09152794ee (diff)
parenta3afe917442fb29627aa9deade1baefbea9a60c5 (diff)
downloadwhich-ui-9dfc98d5014f91afb45ad4eebbe9f0f704ddfdf5.tar.gz
Merge pull request #41 from which-ecosystem/votes
Votes
Diffstat (limited to 'src/pages/AuthPage')
-rw-r--r--src/pages/AuthPage/SignUpForm.tsx9
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);
});
}
};