Skip to content

Commit

Permalink
fix: dirty check
Browse files Browse the repository at this point in the history
  • Loading branch information
jeongho1209 committed Jun 1, 2024
1 parent 1c56eae commit c267ef1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ data class ReviewElement(
val imageUrl1: String?,
val imageUrl2: String?,
val imageUrl3: String?,
val isMine: Boolean,
val isMine: Boolean?,
val accountId: String,
)

Expand Down
3 changes: 3 additions & 0 deletions src/main/kotlin/com/trip/safe/review/service/ReviewService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ class ReviewService(
imageUrl2 = request.imageUrl2,
imageUrl3 = request.imageUrl3
)

reviewRepository.save(review)
}

@Transactional
Expand All @@ -74,6 +76,7 @@ class ReviewService(
}

review.deleteReview()
reviewRepository.save(review)
}

suspend fun getReviewsByTravelDestinationId(
Expand Down
5 changes: 4 additions & 1 deletion src/main/kotlin/com/trip/safe/user/service/UserService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.trip.safe.user.service
import com.trip.safe.common.security.SecurityFacade
import com.trip.safe.common.security.jwt.JwtTokenProvider
import com.trip.safe.review.domain.ReviewRepository
import com.trip.safe.review.presentation.dto.response.toReviewElement
import com.trip.safe.user.domain.User
import com.trip.safe.user.domain.UserRepository
import com.trip.safe.user.exception.PasswordMisMatchException
Expand Down Expand Up @@ -58,10 +59,12 @@ class UserService(
val reviewList = reviewRepository.findAllByUser(user.id)
.collectList().awaitSingle()

val response = reviewList.map { it.toReviewElement(user.accountId) }

return MyInfoResponse(
accountId = user.accountId,
age = user.age,
reviewList = reviewList
reviewList = response,
)
}
}

0 comments on commit c267ef1

Please sign in to comment.