수정/삭제 기능 구현
This commit is contained in:
@@ -771,7 +771,17 @@ const FileUploadComponent: React.FC<FileUploadComponentProps> = ({
|
||||
return;
|
||||
}
|
||||
|
||||
console.log("🖼️ 대표 이미지 로드 시작:", file.realFileName);
|
||||
// objid가 없거나 유효하지 않으면 로드 중단
|
||||
if (!file.objid || file.objid === "0" || file.objid === "") {
|
||||
console.warn("⚠️ 대표 이미지 로드 실패: objid가 없음", file);
|
||||
setRepresentativeImageUrl(null);
|
||||
return;
|
||||
}
|
||||
|
||||
console.log("🖼️ 대표 이미지 로드 시작:", {
|
||||
objid: file.objid,
|
||||
fileName: file.realFileName,
|
||||
});
|
||||
|
||||
// API 클라이언트를 통해 Blob으로 다운로드 (인증 토큰 포함)
|
||||
const response = await apiClient.get(`/files/download/${file.objid}`, {
|
||||
@@ -792,8 +802,12 @@ const FileUploadComponent: React.FC<FileUploadComponentProps> = ({
|
||||
|
||||
setRepresentativeImageUrl(url);
|
||||
console.log("✅ 대표 이미지 로드 성공:", url);
|
||||
} catch (error) {
|
||||
console.error("❌ 대표 이미지 로드 실패:", error);
|
||||
} catch (error: any) {
|
||||
console.error("❌ 대표 이미지 로드 실패:", {
|
||||
file: file.realFileName,
|
||||
objid: file.objid,
|
||||
error: error?.response?.status || error?.message,
|
||||
});
|
||||
setRepresentativeImageUrl(null);
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user