Skip to content

Commit

Permalink
Merge pull request #204 from mash-up-kr/fix/avocado-url-bug
Browse files Browse the repository at this point in the history
�fix: originplace 중복 상황에 대한 핸들링
  • Loading branch information
K-Diger authored Sep 21, 2024
2 parents ffdbbeb + f7c6d50 commit 916b4ed
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ class OriginPlaceAdapter(
private val originPlaceRepository: OriginPlaceRepository,
) : OriginPlaceCommandPort, OriginPlaceQueryPort {
@Transactional
override fun save(originPlace: OriginPlace): OriginPlace {
return originPlaceRepository.save(OriginPlaceEntity.from(originPlace))
.toDomain()
}
override fun save(originPlace: OriginPlace): OriginPlace =
findByOriginMapId(originPlace.originMapId) ?: run {
originPlaceRepository.save(OriginPlaceEntity.from(originPlace)).toDomain()
}

override fun findByOriginMapId(originMapId: OriginMapId): OriginPlace? {
return originPlaceRepository.findByOriginMapId(originMapId)?.toDomain()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ class ShareUrlIdParser(
mutableListOf(
"place/(\\d+)".toRegex(),
"id=(\\d+)".toRegex(),
"pinId=(\\d+)".toRegex(),
)

private val client: RestClient = RestClient.builder().build()
Expand Down

0 comments on commit 916b4ed

Please sign in to comment.