From 02a29cc954224bf72a59b3ba91a537730e78e2b4 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Wed, 25 Jan 2023 16:09:58 +0100 Subject: [PATCH] fix stream .ons --- backend/src/schema/resolvers/images/images.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/backend/src/schema/resolvers/images/images.js b/backend/src/schema/resolvers/images/images.js index 656ae114a..548f7e572 100644 --- a/backend/src/schema/resolvers/images/images.js +++ b/backend/src/schema/resolvers/images/images.js @@ -114,10 +114,11 @@ const localFileUpload = ({ createReadStream, uniqueFilename }) => { const destination = `/uploads/${uniqueFilename}` return new Promise((resolve, reject) => createReadStream() - .pipe(createWriteStream(`public${destination}`)) - .on('finish', () => resolve(destination)) - .on('error', reject), - ) + .pipe(createWriteStream(`public${destination}`) + .on('finish', () => resolve(destination)) + .on('error', (error) => reject(error)) + ) + ) } const s3Upload = async ({ createReadStream, uniqueFilename, mimetype }) => {