From fe61e60b495bdc454b959d669d4a8d15303943b8 Mon Sep 17 00:00:00 2001 From: Akhil Meka Date: Fri, 30 Jan 2026 12:53:11 +0530 Subject: [PATCH] feat: Let users with multiple clients choose client while creating RTS --- src/rts/rts.service.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/rts/rts.service.ts b/src/rts/rts.service.ts index 72fe2a2..1448570 100644 --- a/src/rts/rts.service.ts +++ b/src/rts/rts.service.ts @@ -27,9 +27,12 @@ export async function createRts( user: AuthenticatedUser, ) { let defaultClient = input.client; - const userInDb = await getUserWithoutPopulate(user.userId); - if (userInDb && userInDb.orgId) { - defaultClient = userInDb.orgId[0]?.toString(); + + if (!defaultClient) { + const userInDb = await getUserWithoutPopulate(user.userId); + if (userInDb && userInDb.orgId) { + defaultClient = userInDb.orgId[0]?.toString(); + } } if (!input.stage) {