add otp swagger1
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
import { PrismaClient } from "../lib/generated/prisma";
|
||||
import bcrypt from "bcryptjs";
|
||||
|
||||
const prisma = new PrismaClient();
|
||||
import { db } from "../lib/db";
|
||||
|
||||
async function main() {
|
||||
console.log("🔧 ساخت کاربر ادمین...\n");
|
||||
@@ -11,11 +9,11 @@ async function main() {
|
||||
const hashedPassword = await bcrypt.hash(password, 10);
|
||||
|
||||
// حذف کاربر قبلی اگر وجود دارد
|
||||
await prisma.user.deleteMany({
|
||||
await db.user.deleteMany({
|
||||
where: { email },
|
||||
});
|
||||
|
||||
const user = await prisma.user.create({
|
||||
const user = await db.user.create({
|
||||
data: {
|
||||
email,
|
||||
password: hashedPassword,
|
||||
@@ -40,5 +38,5 @@ main()
|
||||
process.exit(1);
|
||||
})
|
||||
.finally(async () => {
|
||||
await prisma.$disconnect();
|
||||
await db.$disconnect();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user