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
|
// GET /api/channels/[slug]/followers - Get channel followers
|
||||||
export async function GET(
|
export async function GET(
|
||||||
req: NextRequest,
|
req: NextRequest,
|
||||||
{ params }: { params: { slug: string } }
|
{ params }: { params: Promise<{ slug: string }> }
|
||||||
) {
|
) {
|
||||||
try {
|
try {
|
||||||
|
const { slug } = await params
|
||||||
const channel = await prisma.channel.findUnique({
|
const channel = await prisma.channel.findUnique({
|
||||||
where: { slug: params.slug },
|
where: { slug },
|
||||||
include: {
|
include: {
|
||||||
followers: {
|
followers: {
|
||||||
select: {
|
select: {
|
||||||
|
|
|
||||||
|
|
@ -5,11 +5,12 @@ const prisma = new PrismaClient()
|
||||||
|
|
||||||
export async function GET(
|
export async function GET(
|
||||||
req: NextRequest,
|
req: NextRequest,
|
||||||
{ params }: { params: { slug: string } }
|
{ params }: { params: Promise<{ slug: string }> }
|
||||||
) {
|
) {
|
||||||
try {
|
try {
|
||||||
|
const { slug } = await params
|
||||||
const channel = await prisma.channel.findUnique({
|
const channel = await prisma.channel.findUnique({
|
||||||
where: { slug: params.slug },
|
where: { slug },
|
||||||
include: {
|
include: {
|
||||||
user: true,
|
user: true,
|
||||||
stats: true,
|
stats: true,
|
||||||
|
|
|
||||||
2
proxy.ts
2
proxy.ts
|
|
@ -1,7 +1,7 @@
|
||||||
import { createServerClient } from '@supabase/ssr'
|
import { createServerClient } from '@supabase/ssr'
|
||||||
import { NextResponse, NextRequest } from 'next/server'
|
import { NextResponse, NextRequest } from 'next/server'
|
||||||
|
|
||||||
export async function middleware(req: NextRequest) {
|
export async function proxy(req: NextRequest) {
|
||||||
const res = NextResponse.next()
|
const res = NextResponse.next()
|
||||||
|
|
||||||
const supabase = createServerClient(
|
const supabase = createServerClient(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue