From e4785113d9b4025b1161fe8b78c5bd2661d9b125 Mon Sep 17 00:00:00 2001 From: SeieunYoo Date: Sun, 28 Jul 2024 23:44:20 +0900 Subject: [PATCH] =?UTF-8?q?fix=20:=20=EC=95=88=EC=93=B0=EB=8A=94=20api=20?= =?UTF-8?q?=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis/auth/createGuestUserApi.ts | 6 ------ src/apis/auth/index.ts | 1 - src/hooks/mutation/index.ts | 1 - src/hooks/mutation/useCreateGuestUser.ts | 20 -------------------- 4 files changed, 28 deletions(-) delete mode 100644 src/apis/auth/createGuestUserApi.ts delete mode 100644 src/hooks/mutation/useCreateGuestUser.ts diff --git a/src/apis/auth/createGuestUserApi.ts b/src/apis/auth/createGuestUserApi.ts deleted file mode 100644 index bb76259..0000000 --- a/src/apis/auth/createGuestUserApi.ts +++ /dev/null @@ -1,6 +0,0 @@ -import apiClient from '@/apis'; -import type { User } from '@/types/user'; - -export default async function createGuestUserApi(user: User) { - return (await apiClient.post(`/onboarding/members`, user)).data; //이거 안쓰는 거 같은데 -} diff --git a/src/apis/auth/index.ts b/src/apis/auth/index.ts index cbb83a5..a2739f5 100644 --- a/src/apis/auth/index.ts +++ b/src/apis/auth/index.ts @@ -1,2 +1 @@ -export { default as createGuestUserApi } from './createGuestUserApi'; export { default as verifyStudentApi } from './verifyStudentApi'; diff --git a/src/hooks/mutation/index.ts b/src/hooks/mutation/index.ts index c2ad9ab..fdbeeaa 100644 --- a/src/hooks/mutation/index.ts +++ b/src/hooks/mutation/index.ts @@ -1,2 +1 @@ -export { default as useCreateGuestUser } from './useCreateGuestUser'; export { default as useSendStudentEmail } from './useSendStudentEmail'; diff --git a/src/hooks/mutation/useCreateGuestUser.ts b/src/hooks/mutation/useCreateGuestUser.ts deleted file mode 100644 index 54a3182..0000000 --- a/src/hooks/mutation/useCreateGuestUser.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { createGuestUserApi } from '@/apis/auth'; -import LandingStatus from '@/constants/landingStatus'; -import useLandingStatus from '@/hooks/zustand/useLandingStatus'; -import RoutePath from '@/routes/routePath'; -import { useMutation } from '@tanstack/react-query'; -import { useNavigate } from 'react-router-dom'; - -export default function useCreateGuestUser() { - const navigation = useNavigate(); - const { updateLandingStatue } = useLandingStatus(); - const { mutate: createGuestUser, ...rest } = useMutation({ - mutationFn: createGuestUserApi, - onSuccess: () => { - updateLandingStatue(LandingStatus.Dashboard); - navigation(RoutePath.Dashboard, { replace: true }); - } - }); - - return { createGuestUser, ...rest }; -}