Updated
This commit is contained in:
@@ -5,7 +5,7 @@ import { API_ENDPOINTS, QUERY_KEYS } from "~/constants";
|
||||
|
||||
// types
|
||||
|
||||
export type GetProductsResponse = ApiPaginated<Product>;
|
||||
export type GetProductsResponse = ApiPaginated<ProductListItem>;
|
||||
|
||||
export type GetProductsFilters = {
|
||||
search?: string | undefined;
|
||||
@@ -40,8 +40,8 @@ const useGetProducts = (params?: ComputedRef<GetProductsFilters>) => {
|
||||
price_gte: params?.price_gte,
|
||||
price_lte: params?.price_lte,
|
||||
offset: Number(params?.page) * 9 - 9,
|
||||
limit: 9,
|
||||
},
|
||||
limit: 9
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
@@ -51,7 +51,7 @@ const useGetProducts = (params?: ComputedRef<GetProductsFilters>) => {
|
||||
return useQuery({
|
||||
staleTime: 60 * 1000,
|
||||
queryKey: [QUERY_KEYS.products, params],
|
||||
queryFn: () => handleGetProducts(params?.value),
|
||||
queryFn: () => handleGetProducts(params?.value)
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user