added Badges to Dashboard, warning for full events
This commit is contained in:
@@ -69,7 +69,13 @@ export const AppointmentModal = ({
|
||||
})}
|
||||
className="flex flex-col"
|
||||
>
|
||||
<DateInput control={appointmentForm.control} name="appointmentDate" />
|
||||
<DateInput
|
||||
control={appointmentForm.control}
|
||||
name="appointmentDate"
|
||||
showTimeInput
|
||||
timeCaption="Uhrzeit"
|
||||
showTimeCaption
|
||||
/>
|
||||
{/* <Input
|
||||
form={appointmentForm}
|
||||
type="datetime-local"
|
||||
|
||||
@@ -81,7 +81,7 @@ export const Form = ({ event }: { event?: Event }) => {
|
||||
onSubmit={form.handleSubmit(async (values) => {
|
||||
setLoading(true);
|
||||
|
||||
const createdEvent = await upsertEvent(values, event?.id);
|
||||
await upsertEvent(values, event?.id);
|
||||
setLoading(false);
|
||||
if (!event) redirect(`/admin/event`);
|
||||
})}
|
||||
@@ -201,7 +201,7 @@ export const Form = ({ event }: { event?: Event }) => {
|
||||
header: "Datum",
|
||||
accessorKey: "appointmentDate",
|
||||
accessorFn: (date) =>
|
||||
new Date(date.appointmentDate).toLocaleDateString(),
|
||||
new Date(date.appointmentDate).toLocaleString(),
|
||||
},
|
||||
{
|
||||
header: "Presenter",
|
||||
|
||||
@@ -4,6 +4,7 @@ import { Participant, Prisma } from "@repo/db";
|
||||
import { UseFormReturn } from "react-hook-form";
|
||||
import { upsertParticipant } from "../../../events/actions";
|
||||
import { RefObject } from "react";
|
||||
import { deleteParticipant } from "../action";
|
||||
|
||||
interface ParticipantModalProps {
|
||||
participantForm: UseFormReturn<Participant>;
|
||||
@@ -59,6 +60,17 @@ export const ParticipantModal = ({
|
||||
))}
|
||||
</div>
|
||||
<Button type="submit">Speichern</Button>
|
||||
<Button
|
||||
type="button"
|
||||
onSubmit={() => false}
|
||||
onClick={() => {
|
||||
deleteParticipant(participantForm.watch("id"));
|
||||
participantForm.reset();
|
||||
ref.current?.close();
|
||||
}}
|
||||
>
|
||||
Löschen
|
||||
</Button>
|
||||
</form>
|
||||
</div>
|
||||
</dialog>
|
||||
|
||||
Reference in New Issue
Block a user