From e98d3b6071ab25fa824b09e28390c964389f1e97 Mon Sep 17 00:00:00 2001 From: hoyyChoi Date: Sat, 2 Sep 2023 02:53:04 +0900 Subject: [PATCH] feat : no menu, error handling --- source/component/EachShop.js | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/source/component/EachShop.js b/source/component/EachShop.js index 71a4235..f41b055 100644 --- a/source/component/EachShop.js +++ b/source/component/EachShop.js @@ -26,14 +26,18 @@ const EachShop = ({data, key, isEnd}) => { "menu" : {'['} - {data.menu.map((item, index, array) => ( - - {' '} - {'{'} "{item.menuName}" : {item.menuPrice} {'}'} - {index !== array.length - 1 ? ',' : ''} - - - ))} + {data.menu ? ( + data.menu.map((item, index, array) => ( + + {' '} + {'{'} "{item.menuName}" : {item.menuPrice} {'}'} + {index !== array.length - 1 ? ',' : ''} + + + )) + ) : ( + 메뉴가 없습니다. + )} {']'},