Syntax simplification.

This commit is contained in:
Jayden Seric 2017-11-20 15:32:42 +11:00
parent cb77d30070
commit 5329d7002c

View File

@ -18,12 +18,12 @@ const storeUpload = async ({ stream, filename }) => {
const id = shortid.generate()
const path = `${uploadDir}/${id}-${filename}`
return new Promise((resolve, reject) => {
return new Promise((resolve, reject) =>
stream
.pipe(createWriteStream(path))
.on('finish', () => resolve({ id, path }))
.on('error', reject)
})
)
}
const recordFile = file =>