Created
May 25, 2019 23:05
-
-
Save TimothyGu/a3cdd2d898d319631310de726a38aeaf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const { User } = require('./models'); | |
/* eslint-disable no-console, no-await-in-loop */ | |
async function main() { | |
for (const email of process.argv.slice(2)) { | |
const user = await User.getByEmail(email); | |
if (!user) { | |
console.error(email + ' is not a registered email. :('); | |
continue; | |
} | |
await user.setMentorStatus(true); | |
console.log(user.name + ' is now a mentor. :)'); | |
} | |
} | |
main(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment