From 3bd0eba33d11634848013c8ed6bcea922768c2c2 Mon Sep 17 00:00:00 2001 From: myoungjinGo-FE Date: Sun, 8 Dec 2024 16:23:24 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20hook=20=EB=B0=8F=20type=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/{ => apis/customer}/hooks/signUpCustomHook.tsx | 8 ++++---- src/pages/customer/pet/signup/components/Step/step1.tsx | 6 +++--- src/pages/customer/pet/signup/components/Step/step2.tsx | 6 +++--- src/pages/customer/pet/signup/components/Step/step3.tsx | 2 +- src/pages/customer/pet/signup/index.tsx | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) rename src/{ => apis/customer}/hooks/signUpCustomHook.tsx (85%) diff --git a/src/hooks/signUpCustomHook.tsx b/src/apis/customer/hooks/signUpCustomHook.tsx similarity index 85% rename from src/hooks/signUpCustomHook.tsx rename to src/apis/customer/hooks/signUpCustomHook.tsx index acd35b75..422076db 100644 --- a/src/hooks/signUpCustomHook.tsx +++ b/src/apis/customer/hooks/signUpCustomHook.tsx @@ -1,8 +1,8 @@ import { useState, useEffect } from "react"; -import { AddPuppyRequest } from "../types/customer/puppy"; +import { RegisterPuppyRequest } from "../../../types/customer/puppy"; export function signUpCustomHook() { - const [inputData, setInputData] = useState({ + const [inputData, setInputData] = useState({ name: "", breed: "TERRIER", weight: 0, @@ -16,7 +16,7 @@ export function signUpCustomHook() { puppySize: "MEDIUM", }); - const handleChange = (event: React.ChangeEvent, key: string) => { + const handleChange = (event: React.ChangeEvent, key: string) => { const value = event.target.value; console.log(`Key: ${key}, Value: ${value}`); setInputData((prev) => ({ @@ -50,7 +50,7 @@ export function signUpCustomHook() { setInputData((prev) => ({ ...prev, puppySize: size })); }; - const setBreed = (breed: AddPuppyRequest['breed']) => { + const setBreed = (breed: RegisterPuppyRequest['breed']) => { setInputData((prev) => ({ ...prev, breed })); }; diff --git a/src/pages/customer/pet/signup/components/Step/step1.tsx b/src/pages/customer/pet/signup/components/Step/step1.tsx index 1e778521..a46650f9 100644 --- a/src/pages/customer/pet/signup/components/Step/step1.tsx +++ b/src/pages/customer/pet/signup/components/Step/step1.tsx @@ -13,9 +13,9 @@ import { InputWrapper, HalfWrapper, } from "../../index.styles"; -import { AddPuppyRequest } from "../../../../../../types/customer/puppy"; -import { signUpCustomHook } from "../../../../../../hooks/signUpCustomHook"; +import { signUpCustomHook } from "../../../../../../apis/customer/hooks/signUpCustomHook"; +import { RegisterPuppyRequest } from "../../../../../../types/customer/puppy"; interface Step1Props { onNext: () => void; @@ -25,7 +25,7 @@ interface Step1Props { onGenderSelect: (index: string) => void; selectedBreedIndex: string; selectedGenderIndex: string; - inputData: AddPuppyRequest; + inputData: RegisterPuppyRequest; } export default function Step1({ diff --git a/src/pages/customer/pet/signup/components/Step/step2.tsx b/src/pages/customer/pet/signup/components/Step/step2.tsx index faa87753..f74bbaca 100644 --- a/src/pages/customer/pet/signup/components/Step/step2.tsx +++ b/src/pages/customer/pet/signup/components/Step/step2.tsx @@ -1,15 +1,15 @@ -import { signUpCustomHook } from "../../../../../../hooks/signUpCustomHook"; +import { signUpCustomHook } from "../../../../../../apis/customer/hooks/signUpCustomHook"; import { MultiSelectButton } from "../../../../../../components/button/MultiSelectButton"; import { CustomInput } from "../../../../../../components/input/CustomInput"; import { CustomButton } from "../../../../../../components/button/CustomButton"; import { SectionWrapper } from "../../index.styles"; import { Text } from "../../../../../../components/texts/Text"; -import { AddPuppyRequest } from "../../../../../../types/customer/puppy"; +import { RegisterPuppyRequest } from "../../../../../../types/customer/puppy"; interface Step2Props { onNext: () => void; - inputData: AddPuppyRequest; + inputData: RegisterPuppyRequest; } export default function Step2({ onNext }: Step2Props) { diff --git a/src/pages/customer/pet/signup/components/Step/step3.tsx b/src/pages/customer/pet/signup/components/Step/step3.tsx index c68fc762..99eaad25 100644 --- a/src/pages/customer/pet/signup/components/Step/step3.tsx +++ b/src/pages/customer/pet/signup/components/Step/step3.tsx @@ -2,7 +2,7 @@ import { CustomInput } from "../../../../../../components/input/CustomInput"; import { CustomButton } from "../../../../../../components/button/CustomButton"; import { SectionWrapper } from "../../index.styles"; import { Text } from "../../../../../../components/texts/Text"; -import { signUpCustomHook } from "../../../../../../hooks/signUpCustomHook"; +import { signUpCustomHook } from "../../../../../../apis/customer/hooks/signUpCustomHook"; interface Step3Props { onSubmit: () => void; diff --git a/src/pages/customer/pet/signup/index.tsx b/src/pages/customer/pet/signup/index.tsx index 4310605f..f3d88eaa 100644 --- a/src/pages/customer/pet/signup/index.tsx +++ b/src/pages/customer/pet/signup/index.tsx @@ -4,7 +4,7 @@ import { ProgressWrapper, ProgressBlock } from "./index.styles"; import Step1 from "./components/Step/step1"; import Step2 from "./components/Step/step2"; import Step3 from "./components/Step/step3"; -import { signUpCustomHook } from '../../../../hooks/signUpCustomHook'; +import { signUpCustomHook } from '../../../../apis/customer/hooks/signUpCustomHook'; import axios from 'axios'; import { useUserDetails } from "../../../../hooks/useUserDetails";