From c7ee1ec01e404367b24a3570b7b10d2cf5646f52 Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Wed, 30 Sep 2026 09:40:22 -0400 Subject: [PATCH] Update findAllDescendants function signature --- api/src/category.repository.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/api/src/category.repository.ts b/api/src/category.repository.ts index 3afac7b..c0e3437 100644 --- a/api/src/category.repository.ts +++ b/api/src/category.repository.ts @@ -14,14 +14,15 @@ export class CategoryRepository { * Finds all descendants of a given path (including the path itself). * Uses the ltree operator <@ (is-descendant-of). */ - async findAllDescendants(parentPath: string): Promise { + async findAllDescendants(parentPath: string, userId: number): Promise { const query = ` SELECT id, name, path FROM categories WHERE path <@ $1::ltree + AND user_id = $2 -- ORDER BY path ASC; `; - const result = await this.db.query(query, [parentPath]); + const result = await this.db.query(query, [parentPath, userId]); return result.rows; }