Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
students
bora-it
Commits
e72932e2
Commit
e72932e2
authored
Jul 27, 2021
by
이재연
Browse files
s
parent
b9ae2ea0
Changes
1
Hide whitespace changes
Inline
Side-by-side
client/src/components/SignUp.js
View file @
e72932e2
import
axios
from
"
axios
"
;
import
axios
from
"
axios
"
;
import
{
useEffect
,
useState
}
from
"
react
"
;
import
{
useEffect
,
useState
}
from
"
react
"
;
import
userApi
from
"
../apis/user.api
"
;
const
INIT_USER
=
{
const
INIT_USER
=
{
name
:
""
,
name
:
""
,
...
@@ -38,16 +39,16 @@ const Signup = () => {
...
@@ -38,16 +39,16 @@ const Signup = () => {
async
function
handleSubmit
()
{
async
function
handleSubmit
()
{
try
{
try
{
const
data
=
await
axios
.
post
(
"
https://localhost:8080/api/room/1/1
"
,
user
)
const
data
=
await
userApi
.
signup
(
user
)
//
setLoading(true);
setLoading
(
true
);
//
setError("");
setError
(
""
);
// const success = await login(user.email, user.password);
// const success = await login(user.email, user.password);
console
.
log
(
data
);
console
.
log
(
data
);
setSuccess
(
success
);
setSuccess
(
success
);
}
catch
(
error
)
{
}
catch
(
error
)
{
// catchErrors(error, setError);
// catchErrors(error, setError);
}
finally
{
}
finally
{
//
setLoading(false);
setLoading
(
false
);
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment