Skip to content

Commit

Permalink
[KAN-000] 음식점 중복 데이터 발생 해소
Browse files Browse the repository at this point in the history
  • Loading branch information
sinkyoungdeok committed Jun 3, 2024
1 parent 1fe411b commit fff813f
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ class RestaurantRepositoryCustomImpl(
.where(restaurant.id.`in`(restaurantIds))
.leftJoin(restaurantLike).on(restaurant.id.eq(restaurantLike.restaurantId))
.orderBy(*orderSpecifier.toTypedArray())
.fetchJoin()
.offset(pageable.offset)
.limit(pageable.pageSize.toLong())
.fetch()
Expand All @@ -177,7 +176,9 @@ class RestaurantRepositoryCustomImpl(
.where(restaurantCategory.restaurantId.`in`(restaurantIds))
.fetch()

val restaurantDtos = restaurantInfos.map { restaurantInfo ->
val uniqueRestaurantInfos = restaurantInfos.distinctBy { it.id }

val restaurantDtos = uniqueRestaurantInfos.map { restaurantInfo ->
val likedUserIds = restaurantIds.map { true }
val menuList = menus.filter { it.restaurantId == restaurantInfo.id }
val review = reviews.firstOrNull { it.restaurantId == restaurantInfo.id }
Expand Down

0 comments on commit fff813f

Please sign in to comment.