From 252c652fd154682e36b974b0fe709c37e6436ada Mon Sep 17 00:00:00 2001 From: thguss Date: Wed, 4 Sep 2024 15:43:11 +0900 Subject: [PATCH] fix: filtered deletedImageUrls --- .../piikii/application/domain/place/PlaceService.kt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/piikii-application/src/main/kotlin/com/piikii/application/domain/place/PlaceService.kt b/piikii-application/src/main/kotlin/com/piikii/application/domain/place/PlaceService.kt index 29397079..99bab14f 100644 --- a/piikii-application/src/main/kotlin/com/piikii/application/domain/place/PlaceService.kt +++ b/piikii-application/src/main/kotlin/com/piikii/application/domain/place/PlaceService.kt @@ -89,7 +89,7 @@ class PlaceService( targetPlaceId, targetRoomUid, LongTypeId(modifyPlaceRequest.scheduleId), - filterDuplicateUrls(updatedUrls, place), + filterDuplicateUrls(updatedUrls, modifyPlaceRequest.deleteTargetUrls, place), ), ), ) @@ -110,12 +110,13 @@ class PlaceService( private fun filterDuplicateUrls( updatedUrls: List, + deletedUrls: List, place: Place, ): List { - val set = mutableSetOf() - set.addAll(updatedUrls) - set.addAll(place.thumbnailLinks.convertToList) - return set.toList() + return (updatedUrls + place.thumbnailLinks.convertToList) + .toSet() + .filterNot { deletedUrls.contains(it) } + .toList() } companion object {