Skip to content

Commit

Permalink
Refresh user data on address change (#159)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jade-GG authored Dec 17, 2024
1 parent 7a0af4e commit 8b13561
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions resources/views/account/address-edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<graphql-mutation
query="@include('rapidez::account.partials.queries.address-edit')"
:variables="data.customer.addresses.find(a => a.id == {{ request()->id }})"
:callback="refreshUserInfoCallback"
:notify="{ 'message': '@lang('Address changed successfully')' }"
redirect="{{ route('account.edit') }}"
>
Expand Down
1 change: 1 addition & 0 deletions resources/views/account/address-new.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
query="@include('rapidez::account.partials.queries.address-create')"
:variables="{ street: [] }"
:watch="false"
:callback="refreshUserInfoCallback"
:notify="{ 'message': '@lang('Address created successfully')' }"
redirect="{{ route('account.edit') }}"
>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
<graphql-mutation query="mutation deleteCustomerAddress($id: Int!){ deleteCustomerAddress ( id: $id ) }" :variables="{ id: userAddress.id }" v-slot="{ mutate }">
<graphql-mutation
query="mutation deleteCustomerAddress($id: Int!){ deleteCustomerAddress ( id: $id ) }"
:variables="{ id: userAddress.id }"
:callback="refreshUserInfoCallback"
v-slot="{ mutate }"
>
<x-rapidez-ct::button.link v-if="!userAddress.default_billing && !userAddress.default_shipping" v-on:click="data.customer.addresses.splice(addressIndex,1);mutate()">
@lang('Delete address')
</x-rapidez-ct::button.link>
Expand Down

0 comments on commit 8b13561

Please sign in to comment.