fix cursor pagination + flatten variant options field

This commit is contained in:
zakariaelas committed 2021-09-24 01:20:12 +01:00
1 parent 451e3bcdcf
commit 307b1c9342
4 files changed
+43 -8

No files matched your search

+10 -2
View File
@@ -7,7 +7,7 @@ async function loadProductsIntoSearchEngine(container) {
const TAKE = 20
const totalCount = await productService.count()
let iterCount = 0,
lastSeenId = "prod"
lastSeenId = ""
while (iterCount < totalCount) {
const products = await productService.list(
@@ -29,7 +29,15 @@ async function loadProductsIntoSearchEngine(container) {
"created_at",
"updated_at",
],
relations: ["variants", "tags", "type", "collection"],
relations: [
"variants",
"tags",
"type",
"collection",
"variants.prices",
"variants.options",
"options",
],
take: TAKE,
order: { id: "ASC" },
}