Skip to content

Commit

Permalink
hotfix: 음식점 상세 조회 시 이미지 포함하여 응답하도록 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
TaeyeonRoyce committed Sep 11, 2024
1 parent a3e7c08 commit ae9feff
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ class RestaurantPersistenceAdapter(
}

override fun readById(id: Long): Restaurant {
return restaurantPersistenceMapper.toDomainWithoutImage(restaurantJpaRepository.getById(id))
val restaurant = restaurantJpaRepository.getById(id)
val images = restaurantImageJpaRepository.findByRestaurant(restaurant)
return restaurantPersistenceMapper.toDomain(restaurant, images)
}

override fun readCelebrityRecommendRestaurant(): List<Restaurant> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ import org.springframework.data.jpa.repository.JpaRepository

interface RestaurantImageJpaRepository : JpaRepository<RestaurantImageJpaEntity, Long> {
fun findByRestaurantIn(restaurants: List<RestaurantJpaEntity>): List<RestaurantImageJpaEntity>

fun findByRestaurant(restaurant: RestaurantJpaEntity): List<RestaurantImageJpaEntity>
}

0 comments on commit ae9feff

Please sign in to comment.