From 23624dee0a8ee8798219511a90958dca7f4ad81c Mon Sep 17 00:00:00 2001 From: KMKoushik Date: Thu, 6 Feb 2025 00:51:55 +1100 Subject: [PATCH] add team filter --- apps/web/src/server/public-api/api/contacts/get-contacts.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/web/src/server/public-api/api/contacts/get-contacts.ts b/apps/web/src/server/public-api/api/contacts/get-contacts.ts index 59278d2..672b6eb 100644 --- a/apps/web/src/server/public-api/api/contacts/get-contacts.ts +++ b/apps/web/src/server/public-api/api/contacts/get-contacts.ts @@ -53,7 +53,7 @@ function getContacts(app: PublicAPIApp) { app.openapi(route, async (c) => { const team = await getTeamFromToken(c); - await getContactBook(c, team.id); + const cb = await getContactBook(c, team.id); const contactIds = c.req.query("ids")?.split(","); const emails = c.req.query("emails")?.split(","); @@ -64,6 +64,7 @@ function getContacts(app: PublicAPIApp) { where: { id: { in: contactIds }, email: { in: emails }, + contactBookId: cb.id, }, skip: (page - 1) * limit, take: limit,