diff --git a/src/app/api/download-part/[file_id]/[part_index]/route.ts b/src/app/api/download-part/[file_id]/[part_index]/route.ts index 6dc17f2..5f334e0 100644 --- a/src/app/api/download-part/[file_id]/[part_index]/route.ts +++ b/src/app/api/download-part/[file_id]/[part_index]/route.ts @@ -5,8 +5,9 @@ if (!process.env.DISCORD_BOT_TOKEN || !process.env.DISCORD_CHANNEL_ID) { throw new Error('Discord bot token or channel ID is not configured'); } -export async function GET(request: Request, { params }: any) { +export async function GET(request: Request, context: any) { try { + const params = await context.params; const file_id = params.file_id as string; const part_index = params.part_index as string; diff --git a/src/app/api/file/[file_id]/route.ts b/src/app/api/file/[file_id]/route.ts index 4d9aa42..b99337d 100644 --- a/src/app/api/file/[file_id]/route.ts +++ b/src/app/api/file/[file_id]/route.ts @@ -2,8 +2,9 @@ import { NextResponse } from 'next/server'; import pool from '@/lib/db'; import bcrypt from 'bcrypt'; -export async function GET(request: Request, { params }: any) { +export async function GET(request: Request, context: any) { try { + const params = await context.params; const file_id = params.file_id as string; const { searchParams } = new URL(request.url); const token = searchParams.get('token');