fix tenant filtering issue
This commit is contained in:
parent
82397dc516
commit
ea5e564428
|
@ -194,8 +194,7 @@ export const buildUserEndpoints = API => ({
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves the invitation associated with a provided code.
|
* Retrieves all user invitations for the current tenant.
|
||||||
* @param code The unique code for the target invite
|
|
||||||
*/
|
*/
|
||||||
getUserInvites: async () => {
|
getUserInvites: async () => {
|
||||||
return await API.get({
|
return await API.get({
|
||||||
|
|
|
@ -142,12 +142,5 @@ export async function getInviteCodes(tenantIds?: string[]) {
|
||||||
code: invite.key,
|
code: invite.key,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
return results.reduce((acc, invite) => {
|
return results.filter(invite => tenantIds?.length && tenantIds.includes(invite.info.tenantId))
|
||||||
if (tenantIds?.length && tenantIds.includes(invite.info.tenantId)) {
|
|
||||||
acc.push(invite)
|
|
||||||
} else {
|
|
||||||
acc.push(invite)
|
|
||||||
}
|
|
||||||
return acc
|
|
||||||
}, [])
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue