Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/components/discover_rail/shop_wishlist_widget.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class="shop-goals__container">
<div class="shop-goals__items">
<% wishlisted_items.each do |item| %>
<div class="shop-goals__item">
<div class="shop-goals__item" id="shop_wishlist_item_<%= item.id %>">
<%= button_to shop_wishlist_path(item.id), method: :delete, class: "shop-goals__remove", title: "Remove from wishlist" do %>
&times;
<% end %>
Expand Down
6 changes: 5 additions & 1 deletion app/controllers/shop/wishlists_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ def create
def destroy
authorize :shop
current_user.shop_wishlists.where(shop_item_id: params[:id]).destroy_all
render json: { wishlisted: false }

respond_to do |format|
format.json { render json: { wishlisted: false } }
format.turbo_stream { render turbo_stream: turbo_stream.remove("shop_wishlist_item_#{params[:id]}") }
end
end
end