From 87b389e6952d0ade4bb2bb7b3345e833646efa8c Mon Sep 17 00:00:00 2001 From: Fredrik Ringqvist <35255659+fredrikphotowall@users.noreply.github.com> Date: Thu, 11 Jan 2024 12:11:09 +0100 Subject: [PATCH] Replace v_esales_categorytree_i18n with _unmaterialized (#162) --- src/datasources/category-api.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/datasources/category-api.ts b/src/datasources/category-api.ts index b8b8f6b..8df7efc 100644 --- a/src/datasources/category-api.ts +++ b/src/datasources/category-api.ts @@ -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,