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'; 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); const id = parseInt(params.id, 10);
if (isNaN(id)) { if (isNaN(id)) {
return NextResponse.json({ error: 'Invalid ID' }, { status: 400 }); return NextResponse.json({ error: 'Invalid ID' }, { status: 400 });

View File

@ -68,9 +68,10 @@
@layer base { @layer base {
* { * {
@apply border-border; border-color: hsl(var(--border));
} }
body { 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" import type { Config } from "tailwindcss"
const config = { const config = {
darkMode: ["class"], darkMode: "class",
content: [ content: [
'./pages/**/*.{ts,tsx}', './pages/**/*.{ts,tsx}',
'./components/**/*.{ts,tsx}', './components/**/*.{ts,tsx}',