Skip to content
Snippets Groups Projects
Commit cabc5280 authored by 민재 조's avatar 민재 조
Browse files

Fix: partids와 partIds 분기 (임시)

parent e0357cf4
No related branches found
No related tags found
1 merge request!39Fix: partids와 partIds 분기 (임시)
Pipeline #10814 failed
......@@ -9,6 +9,21 @@ const CombinationBox = ({ title, combination }) => {
const fetchPartDetails = async () => {
try {
const details = await Promise.all(
(combination.partids?(
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(' / '),
};
})
):(
combination.partIds.map(async (partId) => {
const partData = await getPartById(partId);
return {
......@@ -22,6 +37,8 @@ const CombinationBox = ({ title, combination }) => {
.join(' / '),
};
})
)
)
);
setPartDetails(details);
} catch (error) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment