Fix: Allow multiple users to add the same book to their shelves without errors (#1297)
This commit is contained in:
@@ -113,7 +113,10 @@ public class BookService {
|
||||
books.stream().map(Book::getId).collect(Collectors.toSet())
|
||||
);
|
||||
|
||||
books.forEach(book -> enrichBookWithProgress(book, progressMap.get(book.getId())));
|
||||
books.forEach(book -> {
|
||||
enrichBookWithProgress(book, progressMap.get(book.getId()));
|
||||
book.setShelves(filterShelvesByUserId(book.getShelves(), user.getId()));
|
||||
});
|
||||
|
||||
return books;
|
||||
}
|
||||
@@ -647,5 +650,4 @@ public class BookService {
|
||||
.filter(shelf -> userId.equals(shelf.getUserId()))
|
||||
.collect(Collectors.toSet());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user