diff --git a/app/api/channels/[slug]/followers/route.ts b/app/api/channels/[slug]/followers/route.ts index 98975d7..cf3d950 100644 --- a/app/api/channels/[slug]/followers/route.ts +++ b/app/api/channels/[slug]/followers/route.ts @@ -7,11 +7,12 @@ const prisma = new PrismaClient() // GET /api/channels/[slug]/followers - Get channel followers export async function GET( req: NextRequest, - { params }: { params: { slug: string } } + { params }: { params: Promise<{ slug: string }> } ) { try { + const { slug } = await params const channel = await prisma.channel.findUnique({ - where: { slug: params.slug }, + where: { slug }, include: { followers: { select: { diff --git a/app/api/channels/[slug]/route.ts b/app/api/channels/[slug]/route.ts index 37bcd29..dc592a2 100644 --- a/app/api/channels/[slug]/route.ts +++ b/app/api/channels/[slug]/route.ts @@ -5,11 +5,12 @@ const prisma = new PrismaClient() export async function GET( req: NextRequest, - { params }: { params: { slug: string } } + { params }: { params: Promise<{ slug: string }> } ) { try { + const { slug } = await params const channel = await prisma.channel.findUnique({ - where: { slug: params.slug }, + where: { slug }, include: { user: true, stats: true, diff --git a/proxy.ts b/proxy.ts index f8d6ed6..9ed833b 100644 --- a/proxy.ts +++ b/proxy.ts @@ -1,7 +1,7 @@ import { createServerClient } from '@supabase/ssr' import { NextResponse, NextRequest } from 'next/server' -export async function middleware(req: NextRequest) { +export async function proxy(req: NextRequest) { const res = NextResponse.next() const supabase = createServerClient(