Skip to content

Commit 4b7f58a

Browse files
committed
fix: missing s3 env variables
1 parent 86a0107 commit 4b7f58a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

apps/web/src/pages/api/upload/image.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import type { NextApiRequest, NextApiResponse } from "next";
22
import { PutObjectCommand, S3Client } from "@aws-sdk/client-s3";
33
import { getSignedUrl } from "@aws-sdk/s3-request-presigner";
4-
import { env } from "next-runtime-env";
4+
import { env as nextRuntimeEnv } from "next-runtime-env";
5+
56
import { createNextApiContext } from "@kan/api/trpc";
67

8+
import { env } from "~/env";
79

810
const allowedContentTypes = ["image/jpeg", "image/png"];
911

@@ -54,7 +56,7 @@ export default async function handler(
5456
// @ts-ignore
5557
client,
5658
new PutObjectCommand({
57-
Bucket: env("NEXT_PUBLIC_AVATAR_BUCKET_NAME") ?? "",
59+
Bucket: nextRuntimeEnv("NEXT_PUBLIC_AVATAR_BUCKET_NAME") ?? "",
5860
Key: filename,
5961
}),
6062
);

0 commit comments

Comments
 (0)