From 6844b1fb24c3539b6999c04f6ea0430f5975c12a Mon Sep 17 00:00:00 2001 From: Spacelord Date: Fri, 21 Feb 2025 22:53:59 +0100 Subject: [PATCH] products GET-> add gtin to if and dont get all if gtin is specified --- src/routes/api/v1/products.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/routes/api/v1/products.ts b/src/routes/api/v1/products.ts index a9c0824..1a19365 100644 --- a/src/routes/api/v1/products.ts +++ b/src/routes/api/v1/products.ts @@ -13,8 +13,8 @@ async function get(req: Request, res: Response) { } else { log.api?.debug('GET products Success:', req.query, value); - if (value.search !== undefined || value.id !== undefined) { - // if search or get by id + if (value.search !== undefined || value.id !== undefined || value.gtin !== undefined) { + // if search or get by id/gtin await db .$transaction([ // Same query for count and findMany