fix. 이미지 경로 에러 수정

This commit is contained in:
clkim
2025-12-05 10:25:23 +09:00
parent 0f5bbc0272
commit 8317fd3665
2 changed files with 4 additions and 12 deletions

View File

@@ -195,17 +195,14 @@ export const getResourceSrc = (
resourcesType?: 'IMG' | 'VID'
) => {
if (!resourcesData) return null
const resPath = resourcesData.res_path
const resType = resourcesType || resourcesData.resource_type
const resPath = resourcesData?.res_path
const resType = resourcesType || resourcesData?.resource_type
const pcField = isTypeVideo(resType) ? 'path_vid_pc' : 'path_pc'
const mobileField = isTypeVideo(resType) ? 'path_vid_mo' : 'path_mo'
const pcPath = resPath[pcField] || resPath[mobileField]
const mobilePath = resPath[mobileField] || resPath[pcField]
// 경로가 없으면 null 반환
if (!pcPath && !mobilePath) return null
const pcPath = resPath?.[pcField] || resPath?.[mobileField] || ''
const mobilePath = resPath?.[mobileField] || resPath?.[pcField] || ''
return {
pc: pcPath,