added missing vendure search input values

This commit is contained in:
Thomas Vogel 2021-06-01 22:23:15 +02:00
parent a98c95d447
commit dabc3073fe
3 changed files with 14 additions and 4 deletions

View File

@ -127,4 +127,3 @@ a {
opacity: 1;
}
}

View File

@ -1,3 +1,3 @@
.fit {
min-height: calc(100vh - 88px);
}
}

View File

@ -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<GetAllProductsQuery>(query, { variables })