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

불필요 코드 개선.

parent d9c6d94a
Branches
No related tags found
1 merge request!37View: Enhanced CombinationGrid layout
...@@ -10,26 +10,15 @@ const CombinationBox = ({ title, combination }) => { ...@@ -10,26 +10,15 @@ const CombinationBox = ({ title, combination }) => {
const fetchPartDetails = async () => { const fetchPartDetails = async () => {
try { try {
const details = await Promise.all( const details = await Promise.all(
combination.partids ?(
combination.partids.map(async (partId) => { combination.partids.map(async (partId) => {
const partData = await getPartById(partId); const partData = await getPartById(partId);
return { return {
image: partData.image_url, image: partData.image_url,
title: partData.name, title: partData.name,
partType: partData.type,
description: partData.description, description: partData.description,
}; };
} })
)):
(
combination.partIds.map(async (partId) => {
const partData = await getPartById(partId);
return {
image: partData.image_url,
title: partData.name,
description: partData.description,
};
}
))
); );
setPartDetails(details); setPartDetails(details);
} catch (error) { } catch (error) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment