File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
templates/types/streaming/nextjs/app/api/files/[...slug] Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -9,9 +9,9 @@ import { DATA_DIR } from "../../chat/engine/loader";
99 */
1010export async function GET (
1111 _request : NextRequest ,
12- { params } : { params : { slug : string [ ] } } ,
12+ { params } : { params : Promise < { slug : string [ ] } > } ,
1313) {
14- const slug = params . slug ;
14+ const slug = ( await params ) . slug ;
1515
1616 if ( ! slug ) {
1717 return NextResponse . json ( { detail : "Missing file slug" } , { status : 400 } ) ;
@@ -21,7 +21,7 @@ export async function GET(
2121 return NextResponse . json ( { detail : "Invalid file path" } , { status : 400 } ) ;
2222 }
2323
24- const [ folder , ...pathTofile ] = params . slug ; // data, file.pdf
24+ const [ folder , ...pathTofile ] = slug ; // data, file.pdf
2525 const allowedFolders = [ "data" , "output" ] ;
2626
2727 if ( ! allowedFolders . includes ( folder ) ) {
You can’t perform that action at this time.
0 commit comments