The Vue Storefront Essentials Course is now available! Learn More
GetOrderDetails

GetOrderDetails

Implements GetOrderDetails Unified Method.

Source

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

export const getOrderDetails = defineApi.getOrderDetails(async (context, args) => {
  const { id } = args;
  const data = await context.api.getUserOrders({ code: id });
  const { normalizeOrder } = getNormalizers(context);

  return normalizeOrder(data, getNormalizerContext(context));
});