Skip to content

useCustomerOrders

useCustomerOrders

Composable for fetching the orders list.

Types

ts
export function useCustomerOrders(): UseCustomerOrdersReturn

source code

ts
export type UseCustomerOrdersReturn = {
  /**
   * All placed orders belonging to the logged-in customer
   */
  orders: Ref<Schemas["Order"][]>;
  /**
   * Changes the current page of the orders list
   *
   * In order to change a page with additional parameters please use `loadOrders` method.
   */
  changeCurrentPage(pageNumber: number | string): Promise<void>;
  /**
   * Fetches the orders list and assigns the result to the `orders` property
   */
  loadOrders(
    parameters?: operations["readOrder post /order"]["body"],
  ): Promise<void>;
  /**
   * Current page number
   */
  currentPage: ComputedRef<number>;
  /**
   * total pages
   */
  totalPages: ComputedRef<number>;
  /**
   * Limit of orders per page
   */
  limit: Ref<number>;
};

source code