Skip to content

Commit

Permalink
Merge pull request #223 from kakao-tech-campus-2nd-step3/HOTFIX/#218-…
Browse files Browse the repository at this point in the history
…menu-imgaes-fix

[fix] 반환값 변경
  • Loading branch information
sanghee0820 authored Nov 15, 2024
2 parents 09b923f + 73400f6 commit 213be8b
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ private static JsonNode facilityTree(String facility) {
ObjectMapper objectMapper = new ObjectMapper();
if (facility == null || facility.isBlank()) {
ObjectNode noDataNode = JsonNodeFactory.instance.objectNode();
noDataNode.put("message", "NO DATA");
noDataNode.put("message", "");
return noDataNode;
}
try {
return objectMapper.readTree(facility);
} catch (Exception e) {
ObjectNode noDataNode = JsonNodeFactory.instance.objectNode();
noDataNode.put("message", "NO DATA");
noDataNode.put("message", "");
return noDataNode;
}
}
Expand All @@ -70,7 +70,7 @@ public static MenuInfos of(
menuImgUrls = menuImgUrls.stream()
.filter(url -> url != null && url.isBlank())
.toList()
.isEmpty() ? null : menuImgUrls;
.stream().allMatch(String::isEmpty) ? null : menuImgUrls;
List<MenuInfo> menuList = menus.stream()
.map(menu -> new MenuInfo(menu.getPrice(), menu.isRecommend(),
menu.getMenuName(), menu.getMenuImgUrl().trim(), menu.getDescription()))
Expand Down

0 comments on commit 213be8b

Please sign in to comment.