Initial commit: YouTube Studio Flow (backend, frontend, infrastructure, docs)
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* Usage: npx ts-node prisma/make-admin.ts <email>
|
||||
* Promotes an existing user to app-level admin (isAppAdmin = true) by email.
|
||||
* Run this once after the first Google sign-in.
|
||||
*/
|
||||
import { PrismaClient } from '@prisma/client';
|
||||
|
||||
const prisma = new PrismaClient();
|
||||
|
||||
async function main() {
|
||||
const email = process.argv[2];
|
||||
if (!email) {
|
||||
console.error('Usage: npx ts-node prisma/make-admin.ts <email>');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const user = await prisma.user.update({
|
||||
where: { email },
|
||||
data: { isAppAdmin: true },
|
||||
});
|
||||
|
||||
console.log(`✓ ${user.name} (${user.email}) is now an app admin`);
|
||||
}
|
||||
|
||||
main()
|
||||
.catch((e) => { console.error(e); process.exit(1); })
|
||||
.finally(() => prisma.$disconnect());
|
||||
Reference in New Issue
Block a user