Skip to content

Commit

Permalink
fix(blob): give options for blob dashboard as query
Browse files Browse the repository at this point in the history
  • Loading branch information
atinux committed Apr 26, 2024
1 parent 10bb263 commit a245a38
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/runtime/server/api/_hub/blob/index.post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ export default eventHandler(async (event) => {
await requireNuxtHubAuthorization(event)
requireNuxtHubFeature('blob')

const query = getQuery(event)
const options = { ...query } as BlobPutOptions

const form = await readFormData(event)
const files = form.getAll('files') as File[]
if (!files) {
Expand All @@ -17,8 +20,7 @@ export default eventHandler(async (event) => {
const objects: BlobObject[] = []
try {
for (const file of files) {
// const object = await blob.put(file.name!, file, { addRandomSuffix: true })
const object = await blob.put(file.name!, file)
const object = await blob.put(file.name!, file, options)
objects.push(object)
}
} catch (e: any) {
Expand Down

0 comments on commit a245a38

Please sign in to comment.