backlinks-api / makeAdmin.js
Abhises's picture
added role for the user and notification form the admin to the user
3d52d95
Raw History Blame Contribute Delete
402 Bytes
const prisma = require('./src/lib/prisma');
async function run() {
const user = await prisma.user.findFirst();
if (user) {
await prisma.user.update({
where: { id: user.id },
data: { role: 'ADMIN' }
});
console.log('Made user ' + user.email + ' an ADMIN');
} else {
console.log('No users found');
}
}
run().catch(console.error).finally(() => prisma.$disconnect());