Skip to content

Commit 0ae27d8

Browse files
committed
chore: clean code
1 parent 2101ceb commit 0ae27d8

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

_nuxthub/server/utils/blob.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ export function useBlob () {
111111
baseURL: proxyURL,
112112
method: 'HEAD'
113113
})
114-
console.log('head headers', headers.get('x-blob'))
115114
return JSON.parse(headers.get('x-blob') || '{}') as BlobObject
116115
}
117116
// Use R2 binding

server/api/storage/upload.post.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
export default eventHandler(async (event) => {
2-
console.log('before')
32
const form = await readFormData(event)
4-
console.log('getting file')
53
const file = form.get('file') as Blob
6-
console.log('after')
74

85
if (!file || !file.size) {
9-
throw createError({ status: 400, message: 'No file provided' })
6+
throw createError({ statusCode: 400, message: 'No file provided' })
107
}
118

129
if (!file.type.startsWith('image/')) {
13-
throw createError({ status: 400, message: 'File must be an image' })
10+
throw createError({ statusCode: 400, message: 'File must be an image' })
1411
}
1512

1613
return useBlob().put(`images/${file.name}`, file)

0 commit comments

Comments
 (0)