Vue Storefront is now Alokai! Learn More
GetCart

GetCart

Implements GetCart Unified Method.

Source

import { defineApi, getCartFromContext } from "@vsf-enterprise/unified-api-sapcc";
import { getNormalizers } from "@vue-storefront/unified-data-model";
import "./extended.d";

export const getCart = defineApi.getCart(async (context, args) => {
  const data = await getCartFromContext(context, args);
  const { normalizeCart } = getNormalizers(context);

  return normalizeCart(data);
});