Skip to content
On this page

useCustomerOrders ​

Definition ​

Composable for fetching the orders list.

Basic usage ​

ts
const { 
 orders,
 changeCurrentPage,
 loadOrders 
} = useCustomerOrders();

Signature ​

ts
export function useCustomerOrders(): UseCustomerOrdersReturn 

Return type ​

See UseCustomerOrdersReturn
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?: Schemas["Criteria"]): Promise<void>;
};

Properties ​

NameTypeDescription
orders
Ref<Array<>>
All placed orders belonging to the logged-in customer

Methods ​

NameTypeDescription
changeCurrentPage
Promise<void>
Changes the current page of the orders listIn order to change a page with additional parameters please use `loadOrders` method.
loadOrders
Promise<void>
Fetches the orders list and assigns the result to the `orders` property
useCustomerOrders has loaded