theming, date, time localisation, additional features, seeding initial cleanup
This commit is contained in:
@@ -5,14 +5,14 @@ import { timeSlots } from '@/lib/db/schema';
|
||||
import { eq } from 'drizzle-orm';
|
||||
import { logActivity, ACTIONS, ENTITY_TYPES } from '@/lib/activity-logger';
|
||||
|
||||
export async function PUT(request: NextRequest, { params }: { params: { id: string } }) {
|
||||
export async function PUT(request: NextRequest, context: { params: Promise<{ id: string }> }) {
|
||||
try {
|
||||
const session = await getSession();
|
||||
if (!session || session.role !== 'admin') {
|
||||
return NextResponse.json({ error: 'Unauthorized' }, { status: 401 });
|
||||
}
|
||||
|
||||
const { id } = params;
|
||||
const { id } = await context.params;
|
||||
const { dayOfWeek, startTime, endTime, isActive } = await request.json();
|
||||
|
||||
// Check if time slot exists
|
||||
@@ -68,14 +68,14 @@ export async function PUT(request: NextRequest, { params }: { params: { id: stri
|
||||
}
|
||||
}
|
||||
|
||||
export async function DELETE(request: NextRequest, { params }: { params: { id: string } }) {
|
||||
export async function DELETE(request: NextRequest, context: { params: Promise<{ id: string }> }) {
|
||||
try {
|
||||
const session = await getSession();
|
||||
if (!session || session.role !== 'admin') {
|
||||
return NextResponse.json({ error: 'Unauthorized' }, { status: 401 });
|
||||
}
|
||||
|
||||
const { id } = params;
|
||||
const { id } = await context.params;
|
||||
|
||||
// Check if time slot exists
|
||||
const existingTimeSlot = await db.select().from(timeSlots).where(eq(timeSlots.id, id)).limit(1);
|
||||
|
||||
Reference in New Issue
Block a user