Skip to content

Commit

Permalink
build issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ShivanshPlays committed Oct 18, 2024
1 parent c0bdb33 commit 6ac3ee5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 16 deletions.
25 changes: 11 additions & 14 deletions app/api/auth/signup/seller/route.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { NextResponse } from 'next/server';
import { PrismaClient } from '@prisma/client';
import bcrypt from 'bcrypt';
// import bcrypt from 'bcrypt';

const prisma = new PrismaClient();

export async function POST(request: Request) {
const { email, password , mobileNumber,name } = await request.json();

const { email} = await request.json();
// storeMobile,name
// Check if the user already exists
const existingUser = await prisma.user.findUnique({
where: { email },
Expand All @@ -16,20 +16,17 @@ export async function POST(request: Request) {
return NextResponse.json({ message: 'Seller already exists' }, { status: 400 });
}

// Hash the password
const passwordHash = await bcrypt.hash(password, 10);

// Create the user
const user = await prisma.seller.create({
data: {
email,
passwordHash,
mobileNumber,
name
},
});
// const user = await prisma.seller.create({
// data: {
// email,
// storeMobile,
// name
// },
// });



return NextResponse.json({ message: 'Signup successful!',user });
return NextResponse.json({ message: 'Signup successful!' });
}
4 changes: 2 additions & 2 deletions prisma/seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ async function main() {
mobileNumber: "1234567899",
name: "John Doe",
email: "john@examplle.com",
passwordHash: hashedPassword1,
// passwordHash: hashedPassword1,
},
});

Expand All @@ -25,7 +25,7 @@ async function main() {
mobileNumber: "0987654322",
name: "Jane Smith",
email: "jane@examplee.com",
passwordHash: hashedPassword2,
// passwordHash: hashedPassword2,
},
});

Expand Down

0 comments on commit 6ac3ee5

Please sign in to comment.