modified: proxy.ts
This commit is contained in:
parent
2029197137
commit
3dcd638f99
3 changed files with 7 additions and 5 deletions
|
|
@ -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: {
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
2
proxy.ts
2
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(
|
||||
|
|
|
|||
Loading…
Reference in a new issue