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 }, body: { search, category, brand, sort: sortParam },
config, config,
}) => { }) => {
let filter: any = {} let filter: any = {
kind: 'SimpleProduct',
}
let sort = {} let sort = {}
if (search) filter['$text'] = { $search: search } if (search) filter['$text'] = { $search: search }

View File

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

View File

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