feat(api): manage users in org and project level without waiting for confirmation

This commit is contained in:
=
2024-09-06 23:31:55 +05:30
parent 9cf917de07
commit 1292b5bf56
11 changed files with 491 additions and 331 deletions
+2 -3
View File
@@ -82,10 +82,9 @@ export const userDALFactory = (db: TDbClient) => {
}
};
const findUserEncKeyByUserId = async (userId: string) => {
const findUserEncKeyByUserId = async (userId: string, tx?: Knex) => {
try {
const user = await db
.replicaNode()(TableName.Users)
const user = await (tx || db.replicaNode())(TableName.Users)
.where(`${TableName.Users}.id`, userId)
.join(TableName.UserEncryptionKey, `${TableName.Users}.id`, `${TableName.UserEncryptionKey}.userId`)
.first();