-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#9: attempt to support Hearings as well as JCTs
- Loading branch information
Showing
8 changed files
with
105 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,17 @@ | ||
"use server"; | ||
|
||
import { getSignedUrlForUpload } from "@/lib/getSignedUrlForUpload"; | ||
import { DocType } from "@/types/DocType"; | ||
|
||
export async function startUpload({ filename }: { filename: string }) { | ||
const result = await getSignedUrlForUpload({ filename }); | ||
export async function startUpload({ | ||
filename, | ||
folderName, | ||
docType | ||
}: { | ||
filename: string, | ||
folderName: string, | ||
docType: DocType | ||
}) { | ||
const result = await getSignedUrlForUpload({ filename, folderName, docType }); | ||
return result.url; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export type DocType = "JCT" | "Hearing"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[ | ||
{ | ||
"AllowedHeaders": [ | ||
"*" | ||
], | ||
"AllowedMethods": [ | ||
"PUT" | ||
], | ||
"AllowedOrigins": [ | ||
"<DOMAIN_NAME>" | ||
], | ||
"ExposeHeaders": [], | ||
"MaxAgeSeconds": 3000 | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"Version": "2012-10-17", | ||
"Statement": [ | ||
{ | ||
"Effect": "Allow", | ||
"Principal": { | ||
"AWS": "arn:aws:iam::<ACCOUNT_ID>:root" | ||
}, | ||
"Action": "s3:PutObject", | ||
"Resource": "arn:aws:s3:::<BUCKET_NAME>/*" | ||
}, | ||
{ | ||
"Effect": "Allow", | ||
"Principal": "*", | ||
"Action": "s3:GetObject", | ||
"Resource": "arn:aws:s3:::<BUCKET_NAME>/*" | ||
} | ||
] | ||
} |