Skip to content

Commit 2c174fa

Browse files
authored
Merge pull request #223 from techulus/main
Fix media endpoint
2 parents 6c47e3f + 7e711cf commit 2c174fa

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

  • app/(api)/api/blob/[fileId]/[fileName]

app/(api)/api/blob/[fileId]/[fileName]/route.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1+
import { eq } from "drizzle-orm";
2+
import type { NextRequest } from "next/server";
13
import { blob } from "@/drizzle/schema";
24
import { getUrl } from "@/lib/blobStore";
35
import { database } from "@/lib/utils/useDatabase";
46
import { getOwner } from "@/lib/utils/useOwner";
5-
import { eq } from "drizzle-orm";
6-
import type { NextRequest } from "next/server";
77

88
export 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) {

0 commit comments

Comments
 (0)