Skip to content

Commit

Permalink
frontend: signup page handleSubmit 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
kimtaejin3 committed Dec 12, 2024
1 parent 86a1b41 commit 7b9b843
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
Binary file modified backend/__pycache__/database.cpython-313.pyc
Binary file not shown.
Binary file modified backend/__pycache__/main.cpython-313.pyc
Binary file not shown.
4 changes: 2 additions & 2 deletions frontend/src/app/(auth)/signin/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default function Page() {
});

// const [signIn, {isError, isSuccess, error, data}] = useSignInMutation();
const { mutate: signInMutation, isError, error, data } = useMutation({
const { mutate: signInMutation, isError,isSuccess, error, data } = useMutation({
mutationFn: ({username, password}: {username: string, password: string}) => signIn(username, password),
});

Expand All @@ -39,7 +39,7 @@ export default function Page() {
return;
}

if(data){
if(isSuccess){
alert('로그인에 성공했습니다.');
console.log('data:', data);

Expand Down
8 changes: 5 additions & 3 deletions frontend/src/app/(auth)/signup/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const INITIAL_FORM = {
export default function Page() {
const [form, setForm] = useState(INITIAL_FORM);

const { mutate: signUpMutation, isError, error } = useMutation({
const { mutate: signUpMutation, isError, isSuccess, error } = useMutation({
mutationFn: ({username, password}: {username: string, password: string}) => signUp(username, password),
});

Expand All @@ -44,8 +44,10 @@ export default function Page() {
return;
}

alert('회원가입에 성공했습니다.');
router.push('/signin');
if(isSuccess){
alert('회원가입에 성공했습니다.');
router.push('/signin');
}
};

return (
Expand Down

0 comments on commit 7b9b843

Please sign in to comment.