fix: Update parameter destructuring in GET functions for consistency
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user