Skip to content

Commit

Permalink
[fix] fix FavoriteImage update logic (#239)
Browse files Browse the repository at this point in the history
  • Loading branch information
PicturePark1101 authored Dec 27, 2024
1 parent 3c8d981 commit 14c225d
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ private void checkTitleExists(final String title, final User user){
}

private void copySharedFavoriteStore(final long sharedId, final Favorite myFavorite) {
findStoresById(sharedId).forEach(it -> favoriteStoreUpdater.save(FavoriteStore.create(it, myFavorite)));
List<Store> storesInFavoriteStore = findStoresById(sharedId);
storesInFavoriteStore.forEach(it -> favoriteStoreUpdater.save(FavoriteStore.create(it, myFavorite)));
myFavorite.updateImageByFavoriteStoreCount(storesInFavoriteStore.size());
}

private List<Store> findStoresById(final long id) {
Expand Down

0 comments on commit 14c225d

Please sign in to comment.