Skip to content

Commit

Permalink
fix: 이미지 fetch 결과를 request body에 넣기 (#328)
Browse files Browse the repository at this point in the history
* fix: request body에 이미지 응답 url 넣기

* fix: club image api toast 훅으로 변경

* chore: import 정리

* feat: mutation toast 훅 적용 안하게 수정
  • Loading branch information
Yejin0O0 authored Dec 13, 2024
1 parent 534a4a5 commit 8bd61d9
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion components/club/ClubForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion components/pages/myPage/EditProfileDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ function EditProfileDialog({
} else {
putProfile({
name,
profile_image_url: profileImage,
profile_image_url: data.profileImage,
});
}
};
Expand Down
1 change: 1 addition & 0 deletions lib/api/hooks/clubHook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ export const usePostClubsImg = () => {
onError: (error: Error) => alert(error),
});
};

export const useGetClubsById = (clubId: string) => {
return useQueryWithToast<GetClubDetailData>(
["clubsDataById", clubId],
Expand Down
21 changes: 10 additions & 11 deletions lib/api/hooks/memberHook.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
import type {
GetMemberMachesRecordData,
GetMemberMyClubsData,
GetMemberMyPageData,
PutMemberProfileData,
PutMemberProfileRequest,
} from "@/types/memberTypes";
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
import {
getMembersMatchesRecord,
getMembersMyClubs,
getMembersMyPage,
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({
Expand Down

0 comments on commit 8bd61d9

Please sign in to comment.