Tenantid optional
This commit is contained in:
parent
6f1d027126
commit
7b4585ce68
|
@ -110,7 +110,7 @@ export async function getUser(
|
|||
* @param {*} tenantId the tenant of the users to get
|
||||
* @returns
|
||||
*/
|
||||
export async function getUsers(userIds: string[], tenantId: string) {
|
||||
export async function getUsers(userIds: string[], tenantId?: string) {
|
||||
const client = await redis.getUserClient()
|
||||
// try cache
|
||||
let usersFromCache = await client.bulkGet(userIds)
|
||||
|
@ -118,6 +118,7 @@ export async function getUsers(userIds: string[], tenantId: string) {
|
|||
const users = Object.values(usersFromCache)
|
||||
|
||||
if (missingUsersFromCache.length) {
|
||||
tenantId ??= context.getTenantId()
|
||||
const usersFromDb = await populateUsersFromDB(
|
||||
missingUsersFromCache,
|
||||
tenantId
|
||||
|
|
Loading…
Reference in New Issue