Skip to content

Commit a245a38

Browse files
committed
fix(blob): give options for blob dashboard as query
1 parent 10bb263 commit a245a38

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/runtime/server/api/_hub/blob/index.post.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ export default eventHandler(async (event) => {
77
await requireNuxtHubAuthorization(event)
88
requireNuxtHubFeature('blob')
99

10+
const query = getQuery(event)
11+
const options = { ...query } as BlobPutOptions
12+
1013
const form = await readFormData(event)
1114
const files = form.getAll('files') as File[]
1215
if (!files) {
@@ -17,8 +20,7 @@ export default eventHandler(async (event) => {
1720
const objects: BlobObject[] = []
1821
try {
1922
for (const file of files) {
20-
// const object = await blob.put(file.name!, file, { addRandomSuffix: true })
21-
const object = await blob.put(file.name!, file)
23+
const object = await blob.put(file.name!, file, options)
2224
objects.push(object)
2325
}
2426
} catch (e: any) {

0 commit comments

Comments
 (0)