fill linked institution ids on data fetching (#8042)

GitOrigin-RevId: 5c89d32331e745e3d993d549337c2c413193a2b2
This commit is contained in:
ilkin-overleaf 2022-05-19 15:02:17 +03:00 committed by Copybot
parent 487ff4f505
commit db1198597d

View file

@ -83,12 +83,18 @@ const setData = (state: State, action: ActionSetData) => {
idAttribute: 'email',
})
const byId = normalized || {}
const linkedInstitutionIds = action.payload
.filter(email => Boolean(email.samlProviderId))
.map(email => email.samlProviderId) as NonNullable<
UserEmailData['samlProviderId']
>[]
return {
...state,
data: {
...initialState.data,
byId,
linkedInstitutionIds,
},
}
}