feat: Let users with multiple clients choose client while creating RTS
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user