feat: Let users with multiple clients choose client while creating RTS

This commit is contained in:
2026-01-30 12:53:11 +05:30
parent 1499ff9804
commit fe61e60b49

View File

@@ -27,9 +27,12 @@ export async function createRts(
user: AuthenticatedUser, user: AuthenticatedUser,
) { ) {
let defaultClient = input.client; let defaultClient = input.client;
const userInDb = await getUserWithoutPopulate(user.userId);
if (userInDb && userInDb.orgId) { if (!defaultClient) {
defaultClient = userInDb.orgId[0]?.toString(); const userInDb = await getUserWithoutPopulate(user.userId);
if (userInDb && userInDb.orgId) {
defaultClient = userInDb.orgId[0]?.toString();
}
} }
if (!input.stage) { if (!input.stage) {