overleaf/services/web/scripts/upgrade_institution_users.js

15 lines
444 B
JavaScript
Raw Normal View History

const InstitutionsManager = require('../app/js/Features/Institutions/InstitutionsManager')
2018-07-10 17:53:06 -04:00
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) {
2018-07-10 17:53:06 -04:00
if (error) {
console.log(error)
} else {
console.log('DONE 👌')
}
process.exit()
})