Skip to content

Commit 194fd2b

Browse files
authored
fix(category): fix category list query (#3059)
Signed-off-by: Gašper Grom <gasper.grom@gmail.com>
1 parent 4a3dc86 commit 194fd2b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • services/libs/data-access-layer/src/categories

services/libs/data-access-layer/src/categories/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,11 +465,11 @@ export async function listCategories(
465465
}[]
466466
> {
467467
return qx.select(
468-
` SELECT c.id, c.name, cg.id as "categoryGroupId", cg.name as "categoryGroupName"
468+
` SELECT c.id, c.name, cg.id as "categoryGroupId", cg.name as "categoryGroupName", cg.type as "categoryGroupType"
469469
FROM "categories" c
470470
JOIN "categoryGroups" cg ON c."categoryGroupId" = cg.id
471471
WHERE c.name ILIKE $(query)
472-
AND COALESCE($(groupType), type) = type
472+
AND COALESCE($(groupType), cg.type) = cg.type
473473
ORDER BY cg.name
474474
LIMIT $(limit)
475475
OFFSET $(offset)

0 commit comments

Comments
 (0)