mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-11 07:00:47 +02:00
Merge pull request #7721 from overleaf/jel-td-notify-commons
Only handle confirmed users via commons script GitOrigin-RevId: 0d00147943228bff6c435848ff88481c5c184a8a
This commit is contained in:
@@ -22,6 +22,17 @@ const InstitutionsAPI = {
|
||||
)
|
||||
},
|
||||
|
||||
getConfirmedInstitutionAffiliations(institutionId, callback) {
|
||||
makeAffiliationRequest(
|
||||
{
|
||||
method: 'GET',
|
||||
path: `/api/v2/institutions/${institutionId.toString()}/confirmed_affiliations`,
|
||||
defaultErrorMessage: "Couldn't get institution affiliations",
|
||||
},
|
||||
(error, body) => callback(error, body || [])
|
||||
)
|
||||
},
|
||||
|
||||
getInstitutionAffiliationsCounts(institutionId, callback) {
|
||||
makeAffiliationRequest(
|
||||
{
|
||||
@@ -267,6 +278,7 @@ function makeAffiliationRequest(options, callback) {
|
||||
}
|
||||
;[
|
||||
'getInstitutionAffiliations',
|
||||
'getConfirmedInstitutionAffiliations',
|
||||
'getUserAffiliations',
|
||||
'addAffiliation',
|
||||
'removeAffiliation',
|
||||
|
||||
@@ -4,6 +4,7 @@ const { ObjectId } = require('mongodb')
|
||||
const Settings = require('@overleaf/settings')
|
||||
const {
|
||||
getInstitutionAffiliations,
|
||||
getConfirmedInstitutionAffiliations,
|
||||
promises: InstitutionsAPIPromises,
|
||||
} = require('./InstitutionsAPI')
|
||||
const FeaturesUpdater = require('../Subscription/FeaturesUpdater')
|
||||
@@ -261,8 +262,9 @@ const fetchInstitutionAndAffiliations = (institutionId, callback) =>
|
||||
(institution, cb) =>
|
||||
institution.fetchV1Data((err, institution) => cb(err, institution)),
|
||||
(institution, cb) =>
|
||||
getInstitutionAffiliations(institutionId, (err, affiliations) =>
|
||||
cb(err, institution, affiliations)
|
||||
getConfirmedInstitutionAffiliations(
|
||||
institutionId,
|
||||
(err, affiliations) => cb(err, institution, affiliations)
|
||||
),
|
||||
],
|
||||
callback
|
||||
|
||||
Reference in New Issue
Block a user