diff --git a/components/club/ClubForm.tsx b/components/club/ClubForm.tsx index 22f08c5..4dc6571 100644 --- a/components/club/ClubForm.tsx +++ b/components/club/ClubForm.tsx @@ -149,7 +149,7 @@ function ClubForm(props: ClubFormProps) { const newClubData: ClubForm = { club_name: data.club_name, club_description: data.club_description, - club_image: imgUrl, + club_image: data.club_image, }; if (initialData) return patchClub(newClubData); diff --git a/components/pages/myPage/EditProfileDialog.tsx b/components/pages/myPage/EditProfileDialog.tsx index cff7677..701d6c8 100644 --- a/components/pages/myPage/EditProfileDialog.tsx +++ b/components/pages/myPage/EditProfileDialog.tsx @@ -114,7 +114,7 @@ function EditProfileDialog({ } else { putProfile({ name, - profile_image_url: profileImage, + profile_image_url: data.profileImage, }); } }; diff --git a/lib/api/hooks/clubHook.ts b/lib/api/hooks/clubHook.ts index dafa284..317b9fd 100644 --- a/lib/api/hooks/clubHook.ts +++ b/lib/api/hooks/clubHook.ts @@ -87,6 +87,7 @@ export const usePostClubsImg = () => { onError: (error: Error) => alert(error), }); }; + export const useGetClubsById = (clubId: string) => { return useQueryWithToast( ["clubsDataById", clubId], diff --git a/lib/api/hooks/memberHook.ts b/lib/api/hooks/memberHook.ts index 4ee3542..e46ca45 100644 --- a/lib/api/hooks/memberHook.ts +++ b/lib/api/hooks/memberHook.ts @@ -1,11 +1,3 @@ -import type { - GetMemberMachesRecordData, - GetMemberMyClubsData, - GetMemberMyPageData, - PutMemberProfileData, - PutMemberProfileRequest, -} from "@/types/memberTypes"; -import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"; import { getMembersMatchesRecord, getMembersMyClubs, @@ -13,9 +5,16 @@ import { getMembersSession, postMembersProfileImage, putMembersProfile, -} from "../functions/memberFn"; -import useMutationWithToast from "./useMutationWithToast"; -import useQueryWithToast from "./useQueryWithToast"; +} from "@/lib/api/functions/memberFn"; +import useMutationWithToast from "@/lib/api/hooks/useMutationWithToast"; +import useQueryWithToast from "@/lib/api/hooks/useQueryWithToast"; +import type { + GetMemberMachesRecordData, + GetMemberMyPageData, + PutMemberProfileData, + PutMemberProfileRequest, +} from "@/types/memberTypes"; +import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"; export const useGetMembersSession = () => { return useQuery({