File tree Expand file tree Collapse file tree
app/(api)/api/blob/[fileId]/[fileName] Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import { eq } from "drizzle-orm" ;
2+ import type { NextRequest } from "next/server" ;
13import { blob } from "@/drizzle/schema" ;
24import { getUrl } from "@/lib/blobStore" ;
35import { database } from "@/lib/utils/useDatabase" ;
46import { getOwner } from "@/lib/utils/useOwner" ;
5- import { eq } from "drizzle-orm" ;
6- import type { NextRequest } from "next/server" ;
77
88export async function GET (
99 _ : NextRequest ,
1010 props : { params : Promise < { fileId : string ; fileName : string } > } ,
1111) {
1212 const params = await props . params ;
1313 const { ownerId } = await getOwner ( ) ;
14- const db = await database ( ) ;
14+ const db = database ( ) ;
1515 const { fileId } = params ;
1616 const key = `${ ownerId } /${ fileId } ` ;
1717
@@ -30,7 +30,7 @@ export async function GET(
3030 const headers = new Headers ( ) ;
3131 headers . set ( "Content-Type" , fileDetails . contentType ) ;
3232
33- return new Response ( await file . blob ( ) , {
33+ return new Response ( file . body , {
3434 headers,
3535 } ) ;
3636 } catch ( _e ) {
You can’t perform that action at this time.
0 commit comments