Replace v_esales_categorytree_i18n with _unmaterialized (#162)

This commit is contained in:
Fredrik Ringqvist
2024-01-11 12:11:09 +01:00
committed by GitHub
parent 051355ba6a
commit 87b389e695
+2 -2
View File
@@ -113,7 +113,7 @@ WHERE product_category.product_id = ?
Scopes.LOCALES_READ,
]);
const res = await this.cachedRaw(
`SELECT id, json_object_agg(locale, name) as locale_names FROM v_esales_categorytree_i18n WHERE id IN (${createQuestionMarksFromList(
`SELECT id, json_object_agg(locale, name) as locale_names FROM v_esales_categorytree_i18n_unmaterialized WHERE id IN (${createQuestionMarksFromList(
ids,
)}) GROUP BY id`,
ids,
@@ -145,7 +145,7 @@ WHERE product_category.product_id = ?
Scopes.CATEGORIES_PUBLIC_READ,
]);
const res = await this.cachedRaw(
`SELECT ec.id, ec.locale, getSafeXmlPath(ec.path, 2) as path, ec.name FROM v_esales_categorytree_i18n ec WHERE ec.id IN (${createQuestionMarksFromList(
`SELECT ec.id, ec.locale, getSafeXmlPath(ec.path, 2) as path, ec.name FROM v_esales_categorytree_i18n_unmaterialized ec WHERE ec.id IN (${createQuestionMarksFromList(
ids,
)})`,
ids,