fix(website): update route params type for Next.js 16
Next.js 15+ changed dynamic route params to Promise<...>. Update GET and POST type signatures in blog comments route. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -4,9 +4,9 @@ const API_URL = process.env.MEEZI_API_URL ?? "http://localhost:5001";
|
|||||||
|
|
||||||
export async function GET(
|
export async function GET(
|
||||||
_req: NextRequest,
|
_req: NextRequest,
|
||||||
{ params }: { params: { slug: string } }
|
{ params }: { params: Promise<{ slug: string }> }
|
||||||
) {
|
) {
|
||||||
const { slug } = await Promise.resolve(params);
|
const { slug } = await params;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const res = await fetch(
|
const res = await fetch(
|
||||||
@@ -31,9 +31,9 @@ export async function GET(
|
|||||||
|
|
||||||
export async function POST(
|
export async function POST(
|
||||||
req: NextRequest,
|
req: NextRequest,
|
||||||
{ params }: { params: { slug: string } }
|
{ params }: { params: Promise<{ slug: string }> }
|
||||||
) {
|
) {
|
||||||
const { slug } = await Promise.resolve(params);
|
const { slug } = await params;
|
||||||
|
|
||||||
let body: unknown;
|
let body: unknown;
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user