User Settings

This commit is contained in:
headlesdev
2025-05-17 21:25:09 +02:00
parent bfbc1f4e59
commit be4fd4785d
2 changed files with 46 additions and 8 deletions

View File

@@ -33,6 +33,17 @@ export async function POST(request: NextRequest) {
return NextResponse.json({ error: "User not found" }, { status: 404 });
}
await prisma.user.update({
where: {
id: decoded.id,
},
data: {
username: body.username,
name: body.name,
email: body.email,
},
});
return NextResponse.json({ message: "Profile updated successfully" }, { status: 200 });
} catch (error: any) {
return NextResponse.json({ error: "Internal Server Error" }, { status: 500 });