Skip to content
On this page

useCategorySearch

Definition

Composable for category search.

Basic usage

ts
const {  search } = useCategorySearch();

Signature

ts
export function useCategorySearch(): UseCategorySearchReturn 

Return type

See UseCategorySearchReturn
ts
export type UseCategorySearchReturn = {
  /**
   * Search for category by ID
   * Accepts optional query params and associations
   */
  search(
    categoryId: string,
    options?: {
      withCmsAssociations?: boolean;
      query?: Partial<ShopwareSearchParams>;
    },
  ): Promise<Category>;
};

Methods

NameTypeDescription
search
Promise<Category>
Search for category by IDAccepts optional query params and associations

Usage

ts
import { useCategorySearch } from "@shopware-pwa/composables-next";

const { search } = useCategorySearch();
useCategorySearch has loaded