added User edit
This commit is contained in:
22
apps/hub/app/(app)/admin/user/[id]/page.tsx
Normal file
22
apps/hub/app/(app)/admin/user/[id]/page.tsx
Normal 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>
|
||||
);
|
||||
};
|
||||
@@ -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',
|
||||
},
|
||||
]}
|
||||
/>
|
||||
);
|
||||
Reference in New Issue
Block a user