Skip to content

Commit f037071

Browse files
committed
Fix add book issue on Wishlist page
1 parent 69da43c commit f037071

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Components/Features/Wishlist.jsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ const Wishlist = () => {
4949
setWishlistData(updatedCart);
5050
}
5151

52+
// const addBookToWishlist = (book)=>{
53+
// setWishlistData(prevWishlist => [...prevWishlist, book]);
54+
// }
55+
5256
return (
5357
<>
5458
{isLoading ? <Loader /> : (
@@ -123,8 +127,8 @@ const Wishlist = () => {
123127
disabled= {isSubmitting}
124128
onClick={() => {
125129
setIsSubmitting(true);
126-
addBook(book.title, "wishlist", handleError, handleSuccess)
127-
updateData(book.title);
130+
// addBookToWishlist(book);
131+
addBook(book.title, "wishlist", handleError, handleSuccess, {bookName: book.title})
128132
setLength((prevLength) => prevLength + 1);
129133
setIsSubmitting(false);
130134
}

0 commit comments

Comments
 (0)