From dabc3073fe24a62b2b64e4366d95d29c107335bd Mon Sep 17 00:00:00 2001 From: Thomas Vogel Date: Tue, 1 Jun 2021 22:23:15 +0200 Subject: [PATCH] added missing vendure search input values --- assets/base.css | 1 - assets/components.css | 2 +- framework/vendure/product/get-all-products.ts | 15 +++++++++++++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/assets/base.css b/assets/base.css index dfdaf1475..e63ea1aa4 100644 --- a/assets/base.css +++ b/assets/base.css @@ -127,4 +127,3 @@ a { opacity: 1; } } - diff --git a/assets/components.css b/assets/components.css index 8c4c5a357..ebebcc238 100644 --- a/assets/components.css +++ b/assets/components.css @@ -1,3 +1,3 @@ .fit { min-height: calc(100vh - 88px); -} \ No newline at end of file +} diff --git a/framework/vendure/product/get-all-products.ts b/framework/vendure/product/get-all-products.ts index b292e0246..e947cfb9b 100644 --- a/framework/vendure/product/get-all-products.ts +++ b/framework/vendure/product/get-all-products.ts @@ -4,7 +4,14 @@ import { GetAllProductsQuery } from '../schema' import { normalizeSearchResult } from '../lib/normalize' import { getAllProductsQuery } from '../lib/queries/get-all-products-query' -export type ProductVariables = { first?: number } +export type ProductVariables = { + first?: number + skip?: number + facetValueIds?: number[] | number + collectionSlug?: string + searchTerm?: string + groupByProduct?: boolean +} async function getAllProducts(opts?: { variables?: ProductVariables @@ -26,7 +33,11 @@ async function getAllProducts({ const variables = { input: { take: vars.first, - groupByProduct: true, + skip: vars.skip, + term: vars.searchTerm, + facetValueIds: vars.facetValueIds, + collectionSlug: vars.collectionSlug, + groupByProduct: vars.groupByProduct ? true : false, }, } const { data } = await config.fetch(query, { variables })