From f252f3232eeca27d810ba2c0abafe45fc8579c35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C5=A1per=20Grom?= Date: Tue, 13 May 2025 11:09:45 +0200 Subject: [PATCH] fix(category): fix category list query MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gašper Grom --- services/libs/data-access-layer/src/categories/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/libs/data-access-layer/src/categories/index.ts b/services/libs/data-access-layer/src/categories/index.ts index 4d1d6424f4..341d57856d 100644 --- a/services/libs/data-access-layer/src/categories/index.ts +++ b/services/libs/data-access-layer/src/categories/index.ts @@ -465,11 +465,11 @@ export async function listCategories( }[] > { return qx.select( - ` SELECT c.id, c.name, cg.id as "categoryGroupId", cg.name as "categoryGroupName" + ` SELECT c.id, c.name, cg.id as "categoryGroupId", cg.name as "categoryGroupName", cg.type as "categoryGroupType" FROM "categories" c JOIN "categoryGroups" cg ON c."categoryGroupId" = cg.id WHERE c.name ILIKE $(query) - AND COALESCE($(groupType), type) = type + AND COALESCE($(groupType), cg.type) = cg.type ORDER BY cg.name LIMIT $(limit) OFFSET $(offset)