fix: [수주서] 이미지 프록시 경유로 변경 — 인증 문제 해결

- image_url → image_file_id로 변경
- /api/proxy/files/{id}/view 경유하여 인증 헤더 자동 포함
This commit is contained in:
김보곤
2026-03-22 15:37:03 +09:00
parent 0d54a52942
commit fde2e67760

View File

@@ -27,7 +27,7 @@ interface BendingItem {
name: string;
spec: string;
qty: number;
image_url?: string | null;
image_file_id?: number | null;
}
interface BendingGroup {
@@ -95,11 +95,11 @@ const tdBase = 'border-r border-gray-300 px-1 py-1';
const tdCenter = `${tdBase} text-center`;
const imgPlaceholder = 'flex items-center justify-center border border-dashed border-gray-300 text-gray-400';
/** 절곡품 이미지 렌더링 — image_url 있으면 실제 이미지, 없으면 placeholder */
/** 절곡품 이미지 렌더링 — image_file_id 있으면 프록시 경유 실제 이미지, 없으면 placeholder */
function BendingImage({ items, height = 'h-20' }: { items: BendingItem[]; height?: string }) {
const imageUrl = items.find(i => i.image_url)?.image_url;
if (imageUrl) {
return <img src={imageUrl} alt="" className={`${height} w-full object-contain`} />;
const fileId = items.find(i => i.image_file_id)?.image_file_id;
if (fileId) {
return <img src={`/api/proxy/files/${fileId}/view`} alt="" className={`${height} w-full object-contain`} />;
}
return <div className={`${imgPlaceholder} ${height} w-full`}>IMG</div>;
}