fix: get only simple products

This commit is contained in:
Gérard Le Cloerec 2021-04-07 16:23:00 +02:00
parent e1f2e16b3d
commit 09bc41bb2f
3 changed files with 9 additions and 1 deletions

View File

@ -17,7 +17,9 @@ const getProducts: ProductsHandlers['getProducts'] = async ({
body: { search, category, brand, sort: sortParam },
config,
}) => {
let filter: any = {}
let filter: any = {
kind: 'SimpleProduct',
}
let sort = {}
if (search) filter['$text'] = { $search: search }

View File

@ -54,6 +54,9 @@ async function getAllProductPaths({
method: 'POST',
body: JSON.stringify({
PostBody: {
filter: {
kind: 'SimpleProduct',
},
structure: {
translation: 1,
},

View File

@ -51,6 +51,9 @@ async function getAllProducts({
body: JSON.stringify({
lang: locale,
PostBody: {
filter: {
kind: 'SimpleProduct',
},
structure: {
code: 1,
id: 1,