refactor: Update DELETE function to use NextRequest and Promise for params; enhance CSS with HSL colors; adjust Tailwind config for dark mode

This commit is contained in:
tigeren 2025-08-25 06:47:10 +00:00
parent 83dea7c651
commit 8676a7d05a
3 changed files with 7 additions and 5 deletions

View File

@ -1,8 +1,9 @@
import { NextResponse } from 'next/server';
import { NextRequest, NextResponse } from 'next/server';
import db from '@/db';
export async function DELETE(request: Request, { params }: { params: { id: string } }) {
export async function DELETE(request: NextRequest, { params: paramsPromise }: { params: Promise<{ id: string }> }) {
const params = await paramsPromise;
const id = parseInt(params.id, 10);
if (isNaN(id)) {
return NextResponse.json({ error: 'Invalid ID' }, { status: 400 });

View File

@ -68,9 +68,10 @@
@layer base {
* {
@apply border-border;
border-color: hsl(var(--border));
}
body {
@apply bg-background text-foreground;
background-color: hsl(var(--background));
color: hsl(var(--foreground));
}
}

View File

@ -2,7 +2,7 @@
import type { Config } from "tailwindcss"
const config = {
darkMode: ["class"],
darkMode: "class",
content: [
'./pages/**/*.{ts,tsx}',
'./components/**/*.{ts,tsx}',