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