Syntax simplification.
This commit is contained in:
parent
cb77d30070
commit
5329d7002c
@ -18,12 +18,12 @@ const storeUpload = async ({ stream, filename }) => {
|
|||||||
const id = shortid.generate()
|
const id = shortid.generate()
|
||||||
const path = `${uploadDir}/${id}-${filename}`
|
const path = `${uploadDir}/${id}-${filename}`
|
||||||
|
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) =>
|
||||||
stream
|
stream
|
||||||
.pipe(createWriteStream(path))
|
.pipe(createWriteStream(path))
|
||||||
.on('finish', () => resolve({ id, path }))
|
.on('finish', () => resolve({ id, path }))
|
||||||
.on('error', reject)
|
.on('error', reject)
|
||||||
})
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
const recordFile = file =>
|
const recordFile = file =>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user