generated from fahricansecer/boilerplate-be
This commit is contained in:
22
test-anon.ts
Normal file
22
test-anon.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { PrismaClient } from '@prisma/client';
|
||||
|
||||
const prisma = new PrismaClient();
|
||||
|
||||
async function test() {
|
||||
try {
|
||||
const newAnon = await prisma.user.create({
|
||||
data: {
|
||||
email: 'anonymous@contenthunter.system' + Date.now(),
|
||||
password: 'system-anonymous-no-login',
|
||||
firstName: 'Anonymous',
|
||||
},
|
||||
});
|
||||
console.log("Success:", newAnon);
|
||||
} catch (e: any) {
|
||||
console.error("Prisma Error:", e);
|
||||
} finally {
|
||||
await prisma.$disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
test();
|
||||
Reference in New Issue
Block a user