Skip to content

Commit 11033c2

Browse files
authored
fix: 작품 관리 상세 수정 및 삭제 정상화 (#233)
* fix: 작품상세 수정 안되는 문제 해결 * fix: 수정하기 버튼 활성화 조건 추가 (공연권 가격 입력)
1 parent ab9a838 commit 11033c2

File tree

3 files changed

+96
-341
lines changed

3 files changed

+96
-341
lines changed

package-lock.json

Lines changed: 1 addition & 251 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/api/user/profile/workDetailApi.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,13 @@ export const getWorkDetail = async (
5555
}
5656
};
5757

58+
type ErrorResponse = {
59+
error: string;
60+
};
61+
5862
export const postWorkDetail = async (formData: FormData): Promise<boolean> => {
5963
try {
6064
const headers: Record<string, string> = {
61-
"Content-Type": "multipart/form-data",
6265
Authorization: `Bearer ${Cookies.get("accessToken")}`,
6366
};
6467

@@ -68,10 +71,11 @@ export const postWorkDetail = async (formData: FormData): Promise<boolean> => {
6871

6972
return response.data === true;
7073
} catch (error: any) {
71-
const err = error as AxiosError<{ error: string }>;
72-
const errorMessage =
73-
err.response?.data?.error ?? "작품 정보를 수정하는 데 실패했습니다.";
74-
throw new Error(errorMessage);
74+
const err = error as AxiosError<ErrorResponse>;
75+
console.error("💥 서버 응답 데이터:", err.response?.data);
76+
throw new Error(
77+
err.response?.data?.error ?? "작품 정보를 수정하는 데 실패했습니다."
78+
);
7579
}
7680
};
7781

0 commit comments

Comments
 (0)