diff --git a/src/components/auth/Join.jsx b/src/components/auth/Join.jsx index a9e79750..008de3a5 100644 --- a/src/components/auth/Join.jsx +++ b/src/components/auth/Join.jsx @@ -1,6 +1,6 @@ 'use client' -import { useRef } from 'react' +import { useRef, useState } from 'react' import { useAxios } from '@/hooks/useAxios' import { useRouter } from 'next/navigation' import { useMessage } from '@/hooks/useMessage' @@ -8,7 +8,11 @@ import Cookies from 'js-cookie' import { isObjectNotEmpty, inputTelNumberCheck, inputNumberCheck } from '@/util/common-utils' +import GlobalSpinner from '@/components/common/spinner/GlobalSpinner' + export default function Join() { + const [isLoading, setIsLoading] = useState(false) + const { getMessage } = useMessage() const { promisePost } = useAxios() const router = useRouter() @@ -152,6 +156,8 @@ export default function Join() { }, } + setIsLoading(true) + await promisePost({ url: '/api/login/v1.0/user/join', data: param }) .then((res) => { if (res) { @@ -162,8 +168,10 @@ export default function Join() { alert(res.data.result.resultMsg) } } + setIsLoading(false) }) .catch((error) => { + setIsLoading(false) alert(error.response.data.message) }) } @@ -171,277 +179,280 @@ export default function Join() { } return ( -