mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
9df283caef
Change check_institution_users.js output GitOrigin-RevId: c331d5312dc807fd5118f4ce78737bde04a82c66
21 lines
599 B
JavaScript
21 lines
599 B
JavaScript
const { waitForDb } = require('../app/src/infrastructure/mongodb')
|
|
const InstitutionsManager = require('../app/src/Features/Institutions/InstitutionsManager')
|
|
|
|
const institutionId = parseInt(process.argv[2])
|
|
if (isNaN(institutionId)) throw new Error('No institution id')
|
|
console.log('Checking users of institution', institutionId)
|
|
|
|
waitForDb()
|
|
.then(main)
|
|
.catch(err => {
|
|
console.error(err)
|
|
process.exit(1)
|
|
})
|
|
|
|
async function main() {
|
|
const usersSummary = await InstitutionsManager.promises.checkInstitutionUsers(
|
|
institutionId
|
|
)
|
|
console.log(usersSummary)
|
|
process.exit()
|
|
}
|