1
0
Fork 0
mirror of synced 2024-07-03 13:30:46 +12:00

fix tenant filtering issue

This commit is contained in:
Martin McKeaveney 2023-03-07 09:45:39 +00:00
parent 82397dc516
commit ea5e564428
2 changed files with 2 additions and 10 deletions

View file

@ -194,8 +194,7 @@ export const buildUserEndpoints = API => ({
},
/**
* Retrieves the invitation associated with a provided code.
* @param code The unique code for the target invite
* Retrieves all user invitations for the current tenant.
*/
getUserInvites: async () => {
return await API.get({

View file

@ -142,12 +142,5 @@ export async function getInviteCodes(tenantIds?: string[]) {
code: invite.key,
}
})
return results.reduce((acc, invite) => {
if (tenantIds?.length && tenantIds.includes(invite.info.tenantId)) {
acc.push(invite)
} else {
acc.push(invite)
}
return acc
}, [])
return results.filter(invite => tenantIds?.length && tenantIds.includes(invite.info.tenantId))
}