File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
apps/web/src/pages/api/upload Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 1
1
import type { NextApiRequest , NextApiResponse } from "next" ;
2
2
import { PutObjectCommand , S3Client } from "@aws-sdk/client-s3" ;
3
3
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
+
5
6
import { createNextApiContext } from "@kan/api/trpc" ;
6
7
8
+ import { env } from "~/env" ;
7
9
8
10
const allowedContentTypes = [ "image/jpeg" , "image/png" ] ;
9
11
@@ -54,7 +56,7 @@ export default async function handler(
54
56
// @ts -ignore
55
57
client ,
56
58
new PutObjectCommand ( {
57
- Bucket : env ( "NEXT_PUBLIC_AVATAR_BUCKET_NAME" ) ?? "" ,
59
+ Bucket : nextRuntimeEnv ( "NEXT_PUBLIC_AVATAR_BUCKET_NAME" ) ?? "" ,
58
60
Key : filename ,
59
61
} ) ,
60
62
) ;
You can’t perform that action at this time.
0 commit comments