Skip to content

Commit

Permalink
Update remove button to 2.x (#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jade-GG authored May 14, 2024
1 parent 5148542 commit a48754e
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions resources/views/cart/partials/product/remove-button.blade.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
<button v-on:click="remove(item)" class="text-ct-inactive mt-1 text-xs hover:underline" :dusk="'item-delete-' + index">
@lang('Remove')
</button>
<graphql-mutation
:query="'mutation ($cart_id: String!, $cart_item_id: Int) { removeItemFromCart(input: { cart_id: $cart_id, cart_item_id: $cart_item_id }) { cart { ' + config.queries.cart + ' } } }'"
:variables="{ cart_id: mask, cart_item_id: item.id }"
:notify="{ message: item.product.name+' '+config.translations.cart.remove }"
:callback="updateCart"
:error-callback="checkResponseForExpiredCart"
v-slot="{ mutate }"
>
<button v-on:click="mutate" class="text-ct-inactive mt-1 text-xs hover:underline" :dusk="'item-delete-' + index">
@lang('Remove')
</button>
</graphql-mutation>

0 comments on commit a48754e

Please sign in to comment.