Skip to content
Snippets Groups Projects

Fix: partids와 partIds 분기 (임시)

Merged 민재 조 requested to merge enhanced-description into main
1 file
+ 30
13
Compare changes
  • Side-by-side
  • Inline
@@ -9,19 +9,36 @@ const CombinationBox = ({ title, combination }) => {
@@ -9,19 +9,36 @@ const CombinationBox = ({ title, combination }) => {
const fetchPartDetails = async () => {
const fetchPartDetails = async () => {
try {
try {
const details = await Promise.all(
const details = await Promise.all(
combination.partIds.map(async (partId) => {
(combination.partids?(
const partData = await getPartById(partId);
combination.partids.map(async (partId) => {
return {
const partData = await getPartById(partId);
image: partData.image_url,
return {
title: partData.name,
image: partData.image_url,
partType: partData.type,
title: partData.name,
description: partData.description
partType: partData.type,
.split('/')
description: partData.description
.map(item => item.trim())
.split('/')
.filter(item => item !== '')
.map(item => item.trim())
.join(' / '),
.filter(item => item !== '')
};
.join(' / '),
})
};
 
})
 
):(
 
combination.partIds.map(async (partId) => {
 
const partData = await getPartById(partId);
 
return {
 
image: partData.image_url,
 
title: partData.name,
 
partType: partData.type,
 
description: partData.description
 
.split('/')
 
.map(item => item.trim())
 
.filter(item => item !== '')
 
.join(' / '),
 
};
 
})
 
)
 
)
);
);
setPartDetails(details);
setPartDetails(details);
} catch (error) {
} catch (error) {
Loading