@scayle/storefront-core
Version:
Collection of essential utilities to work with the Storefront API
13 lines (12 loc) • 469 B
JavaScript
import { CustomerAPIClient } from "../../../api/customer.mjs";
import { defineRpcHandler } from "../../../utils/index.mjs";
const getShopUserAddresses = defineRpcHandler(
async (context) => {
const shopId = context.shopId;
const client = new CustomerAPIClient(context);
return (await client.getAddresses(shopId)).entities;
},
// We use POST here to prevent user data to be leaking into caches.
{ method: "POST" }
);
export { getShopUserAddresses };