Skip to content

Commit

Permalink
fix: filtered deletedImageUrls
Browse files Browse the repository at this point in the history
  • Loading branch information
thguss committed Sep 4, 2024
1 parent 212cd72 commit 252c652
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 252c652

Please sign in to comment.