diff --git a/packages/composables/src/hooks/useUser.ts b/packages/composables/src/hooks/useUser.ts index 03450e5d4..01c4a4233 100644 --- a/packages/composables/src/hooks/useUser.ts +++ b/packages/composables/src/hooks/useUser.ts @@ -4,11 +4,13 @@ import { logout as apiLogout, getCustomer, getCustomerOrders, - getCustomerOrderDetails + getCustomerOrderDetails, + getCustomerAddresses } from "@shopware-pwa/shopware-6-client"; import { Customer } from "packages/shopware-6-client/src/interfaces/models/checkout/customer/Customer"; import { getStore } from "@shopware-pwa/composables"; import { Order } from "@shopware-pwa/shopware-6-client/src/interfaces/models/checkout/order/Order"; +import { CustomerAddress } from "@shopware-pwa/shopware-6-client/src/interfaces/models/checkout/customer/CustomerAddress"; interface UseUser { login: ({ @@ -27,6 +29,7 @@ interface UseUser { logout: () => Promise; loadOrders: () => Promise; getOrderDetails: (orderId: string) => Promise; + getAddresses: () => Promise; } export const useUser = (): UseUser => { @@ -81,6 +84,8 @@ export const useUser = (): UseUser => { return getCustomerOrderDetails(orderId); }; + const getAddresses = (): Promise => getCustomerAddresses(); + const isLoggedIn = computed(() => !!user.value); return { @@ -93,6 +98,7 @@ export const useUser = (): UseUser => { logout, orders, loadOrders, - getOrderDetails + getOrderDetails, + getAddresses }; }; diff --git a/packages/default-theme/components/account/Address.vue b/packages/default-theme/components/account/Address.vue index a1b12d736..7c2eab293 100644 --- a/packages/default-theme/components/account/Address.vue +++ b/packages/default-theme/components/account/Address.vue @@ -1,7 +1,6 @@