Skip to content

Commit

Permalink
Merge pull request #192 from mash-up-kr/fix/#191-patch-place-api
Browse files Browse the repository at this point in the history
fix: 장소 수정 API 이미지가 삭제되지 않는 이슈 대응
  • Loading branch information
thguss committed Sep 4, 2024
2 parents 212cd72 + 252c652 commit f5e43d9
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class PlaceService(
targetPlaceId,
targetRoomUid,
LongTypeId(modifyPlaceRequest.scheduleId),
filterDuplicateUrls(updatedUrls, place),
filterDuplicateUrls(updatedUrls, modifyPlaceRequest.deleteTargetUrls, place),
),
),
)
Expand All @@ -110,12 +110,13 @@ class PlaceService(

private fun filterDuplicateUrls(
updatedUrls: List<String>,
deletedUrls: List<String>,
place: Place,
): List<String> {
val set = mutableSetOf<String>()
set.addAll(updatedUrls)
set.addAll(place.thumbnailLinks.convertToList)
return set.toList()
return (updatedUrls + place.thumbnailLinks.convertToList)
.toSet()
.filterNot { deletedUrls.contains(it) }
.toList()
}

companion object {
Expand Down

0 comments on commit f5e43d9

Please sign in to comment.