fix: Update parameter destructuring in GET functions for consistency

This commit is contained in:
2025-10-16 09:36:43 +02:00
parent 3dd56334cf
commit 12fa9812bc
2 changed files with 4 additions and 4 deletions

View File

@@ -5,9 +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 }: { params: { file_id: string, part_index: string } }) {
export async function GET(request: Request, context: { params: { file_id: string, part_index: string } }) {
try {
const { file_id, part_index } = params;
const { file_id, part_index } = context.params;
// NOTE: In a real-world scenario, you MUST validate if the user has permission to download this part.
// This would involve checking the download_token against the hash in the `files` table.

View File

@@ -2,9 +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: { params: { file_id: string } }) {
try {
const file_id = params.file_id as string;
const file_id = context.params.file_id;
const { searchParams } = new URL(request.url);
const token = searchParams.get('token');