Skip to content

Commit

Permalink
feat: remove unnecessary promise
Browse files Browse the repository at this point in the history
  • Loading branch information
braianj committed Oct 5, 2023
1 parent e7f93bc commit 5ed235f
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions src/entities/Report/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,18 @@ export async function getSignedUrl(
const signedUrlExpireSeconds = 60 * 1000

const signedUrl = await retry({}, async () => {
const responseUrl = await Promise.resolve(
s3.getSignedUrl("putObject", {
Bucket: BUCKET_NAME,
Key: `${filename}`,
Expires: signedUrlExpireSeconds,
ContentType: mimetype,
ACL: "private",
CacheControl: "public, max-age=31536000, immutable",
Metadata: {
...userAuth.metadata,
address: userAuth.address,
},
})
)
const responseUrl = s3.getSignedUrl("putObject", {
Bucket: BUCKET_NAME,
Key: `${filename}`,
Expires: signedUrlExpireSeconds,
ContentType: mimetype,
ACL: "private",
CacheControl: "public, max-age=31536000, immutable",
Metadata: {
...userAuth.metadata,
address: userAuth.address,
},
})

const url = new URL(responseUrl)
if (url.searchParams.size === 0) {
Expand Down

0 comments on commit 5ed235f

Please sign in to comment.