Skip to content

Commit

Permalink
fix: hook 및 type 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
myoungjinGo-FE committed Dec 8, 2024
1 parent 8e57c2a commit 3bd0eba
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -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<AddPuppyRequest>({
const [inputData, setInputData] = useState<RegisterPuppyRequest>({
name: "",
breed: "TERRIER",
weight: 0,
Expand All @@ -16,7 +16,7 @@ export function signUpCustomHook() {
puppySize: "MEDIUM",
});

const handleChange = (event: React.ChangeEvent<HTMLInputElement>, key: string) => {
const handleChange = (event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>, key: string) => {
const value = event.target.value;
console.log(`Key: ${key}, Value: ${value}`);
setInputData((prev) => ({
Expand Down Expand Up @@ -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 }));
};

Expand Down
6 changes: 3 additions & 3 deletions src/pages/customer/pet/signup/components/Step/step1.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -25,7 +25,7 @@ interface Step1Props {
onGenderSelect: (index: string) => void;
selectedBreedIndex: string;
selectedGenderIndex: string;
inputData: AddPuppyRequest;
inputData: RegisterPuppyRequest;
}

export default function Step1({
Expand Down
6 changes: 3 additions & 3 deletions src/pages/customer/pet/signup/components/Step/step2.tsx
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/customer/pet/signup/components/Step/step3.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/pages/customer/pet/signup/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down

0 comments on commit 3bd0eba

Please sign in to comment.