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,
|
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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user