Spaces:
Paused
Paused
Download makeAdmin.js from Abhises/backlinks-api: direct link, hf CLI and curl.
- Browser
- Download file 402 Bytes
-
https://huggingface.co/spaces/Abhises/backlinks-api/resolve/main/makeAdmin.js
- Command line
-
hf download hf://spaces/Abhises/backlinks-api/makeAdmin.js
-
curl -L -o makeAdmin.js https://huggingface.co/spaces/Abhises/backlinks-api/resolve/main/makeAdmin.js
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()); | |