fix: update dependencies to latest

This commit is contained in:
Divlo
2023-01-11 18:02:38 +01:00
parent 12dcabccb3
commit e30a66eeb6
26 changed files with 749 additions and 12804 deletions

View File

@ -48,10 +48,10 @@ export const uploadFile = async (
`File should be less than ${MAXIMUM_FILE_SIZE}mb.`
)
}
if (files.length !== 1) {
const file = files[0]
if (files.length !== 1 || file == null) {
throw fastify.httpErrors.badRequest('You must upload at most one file.')
}
const file = files[0]
const formData = new FormData()
formData.append('file', fs.createReadStream(file.filepath))
try {