Füge Benutzerabfrage zum neuen Ereignisformular hinzu und aktualisiere das Ereignisformular-Layout

This commit is contained in:
PxlLoewe
2025-02-22 16:18:19 +01:00
parent 06e8f9e92a
commit 8e1e9a67be
4 changed files with 15 additions and 4 deletions

View File

@@ -16,6 +16,7 @@ export default async ({ params }: { params: Promise<{ id: string }> }) => {
publicId: true,
},
});
console.log(users);
if (!event) return <div>Event not found</div>;
return <Form event={event} users={users} />;
};

View File

@@ -8,7 +8,7 @@ import {
} from '@repo/db/zod';
import { set, useForm } from 'react-hook-form';
import { BADGES, Event, User } from '@repo/db';
import { Bot, FileText, UserIcon } from 'lucide-react';
import { Bot, Calendar, FileText, UserIcon } from 'lucide-react';
import { Input } from '../../../../_components/ui/Input';
import { useRef, useState } from 'react';
import { deleteEvent, upsertEvent } from '../action';
@@ -154,7 +154,7 @@ export const Form = ({
<div className="card-body">
<div className="flex justify-between">
<h2 className="card-title">
<UserIcon className="w-5 h-5" /> Termine
<Calendar className="w-5 h-5" /> Termine
</h2>
<button
className="btn btn-primary btn-outline"

View File

@@ -1,5 +1,14 @@
import { prisma } from '@repo/db';
import { Form } from '../_components/Form';
export default () => {
return <Form />;
export default async () => {
const users = await prisma.user.findMany({
select: {
id: true,
firstname: true,
lastname: true,
publicId: true,
},
});
return <Form users={users} />;
};

View File

@@ -1,4 +1,5 @@
@import 'tailwindcss';
@plugin "daisyui";
/*
The default border color has changed to `currentColor` in Tailwind CSS v4,