useCustomerUpdateAddress
A customer hook that helps you easily update a customer address.
// import
import { useCustomerUpdateAddress } from '@backpackjs/storefront';
// instantiation
const { updateAddress, ...updateStatus } = useCustomerUpdateAddress();
// use
const updatedAddress = await updateAddress({
id,
isDefault,
address
})id
the id of the address being updated
isDefault
true || false sets or unsets an address as default
address
the updated address data { firstName: '..', lastName, address1, address2, city, province, country, "zip", "phone" }
Last updated