Moved Dispatch NAvbar component, to remove code dupl.; Fixed timezone bug in hub

This commit is contained in:
PxlLoewe
2026-01-31 22:11:46 +01:00
parent 580dc32ad0
commit d1c49a3208
18 changed files with 155 additions and 225 deletions

View File

@@ -5,13 +5,14 @@ import { getServerSession } from "../../auth/[...nextauth]/auth";
// DELETE /api/booking/[id] - Delete a booking
export const DELETE = async (req: NextRequest, { params }: { params: { id: string } }) => {
try {
console.log(params);
const session = await getServerSession();
if (!session?.user) {
return NextResponse.json({ error: "Not authenticated" }, { status: 401 });
}
const bookingId = params.id;
const bookingId = (await params).id;
console.log("Attempting to delete booking with ID:", bookingId);
// Find the booking
const booking = await prisma.booking.findUnique({
@@ -40,14 +41,14 @@ export const DELETE = async (req: NextRequest, { params }: { params: { id: strin
};
// PUT /api/booking/[id] - Update a booking
export const PUT = async (req: NextRequest, { params }: { params: { id: string } }) => {
export const PATCH = async (req: NextRequest, { params }: { params: { id: string } }) => {
try {
const session = await getServerSession();
if (!session?.user) {
return NextResponse.json({ error: "Not authenticated" }, { status: 401 });
}
const bookingId = params.id;
const bookingId = (await params).id;
const body = await req.json();
const { type, stationId, startTime, endTime } = body;