Skip to content

Instantly share code, notes, and snippets.

@TimothyGu
Created May 25, 2019 23:05
Show Gist options
  • Save TimothyGu/a3cdd2d898d319631310de726a38aeaf to your computer and use it in GitHub Desktop.
Save TimothyGu/a3cdd2d898d319631310de726a38aeaf to your computer and use it in GitHub Desktop.
'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