overleaf/services/web/scripts/upgrade_institution_users.js

17 lines
449 B
JavaScript
Raw Normal View History

2018-07-10 17:53:06 -04:00
const InstitutionsManager = require(
'../app/js/Features/Institutions/InstitutionsManager'
)
const institutionId = parseInt(process.argv[2])
if (isNaN(institutionId)) throw new Error('No institution id')
console.log('Upgrading users of institution', institutionId)
InstitutionsManager.upgradeInstitutionUsers(institutionId, function (error) {
if (error) {
console.log(error)
} else {
console.log('DONE 👌')
}
process.exit()
})