added User edit

This commit is contained in:
PxlLoewe
2025-02-16 13:10:03 +01:00
parent d16433004f
commit 883c47bdce
5 changed files with 56 additions and 7 deletions

View File

@@ -0,0 +1,22 @@
import { PrismaClient } from '@repo/db';
export default async ({ params }: { params: Promise<{ id: string }> }) => {
const prisma = new PrismaClient();
const { id } = await params;
const user = await prisma.user.findUnique({
where: {
id: id,
},
});
console.log(user);
return (
<div>
<h1>
{user?.firstname} {user?.lastname}
</h1>
<p>{user?.email}</p>
{/* TODO: Hier Nutzerdaten bearbeiten */}
</div>
);
};

View File

@@ -1,8 +1,10 @@
import Link from 'next/link';
import { PaginatedTable } from '../../../_components/PaginatedTable';
export default async () => {
return (
<PaginatedTable
showEditButton
prismaModel="user"
columns={[
{
@@ -21,10 +23,6 @@ export default async () => {
header: 'Email',
accessorKey: 'email',
},
{
header: 'Role',
accessorKey: 'role',
},
]}
/>
);