mirror of
https://github.com/crocofied/CoreControl.git
synced 2025-12-29 16:14:43 +00:00
User Settings
This commit is contained in:
@@ -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 });
|
||||
|
||||
Reference in New Issue
Block a user