mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Merge pull request #16294 from overleaf/em-premium-routes-super-props
Add super properties to support premium routes determination on events GitOrigin-RevId: d85733f25b7bf12ca59591fece8f3cbd604be04f
This commit is contained in:
parent
6948d23adb
commit
ad53583e3a
1 changed files with 4 additions and 3 deletions
|
@ -3,7 +3,7 @@ const UserGetter = require('../User/UserGetter')
|
|||
const UserMembershipsHandler = require('../UserMembership/UserMembershipsHandler')
|
||||
const UserMembershipEntityConfigs = require('../UserMembership/UserMembershipEntityConfigs')
|
||||
|
||||
async function _getCurrentAffiliations(userId) {
|
||||
async function getCurrentAffiliations(userId) {
|
||||
const fullEmails = await UserGetter.promises.getUserFullEmails(userId)
|
||||
// current are those confirmed and not with lapsed reconfirmations
|
||||
return fullEmails
|
||||
|
@ -22,7 +22,7 @@ async function getCurrentInstitutionIds(userId) {
|
|||
// current are those confirmed and not with lapsed reconfirmations
|
||||
// only 1 record returned per current institutionId
|
||||
const institutionIds = new Set()
|
||||
const currentAffiliations = await _getCurrentAffiliations(userId)
|
||||
const currentAffiliations = await getCurrentAffiliations(userId)
|
||||
currentAffiliations.forEach(affiliation => {
|
||||
institutionIds.add(affiliation.institution.id)
|
||||
})
|
||||
|
@ -33,7 +33,7 @@ async function getCurrentInstitutionsWithLicence(userId) {
|
|||
// current are those confirmed and not with lapsed reconfirmations
|
||||
// only 1 record returned per current institution
|
||||
const institutions = {}
|
||||
const currentAffiliations = await _getCurrentAffiliations(userId)
|
||||
const currentAffiliations = await getCurrentAffiliations(userId)
|
||||
currentAffiliations.forEach(affiliation => {
|
||||
if (affiliation.licence && affiliation.licence !== 'free') {
|
||||
institutions[affiliation.institution.id] = affiliation.institution
|
||||
|
@ -78,6 +78,7 @@ const InstitutionsGetter = {
|
|||
}
|
||||
|
||||
InstitutionsGetter.promises = {
|
||||
getCurrentAffiliations,
|
||||
getCurrentInstitutionIds,
|
||||
getCurrentInstitutionsWithLicence,
|
||||
getManagedInstitutions: promisify(InstitutionsGetter.getManagedInstitutions),
|
||||
|
|
Loading…
Reference in a new issue