Skip to content

Commit

Permalink
Merge pull request #365 from julianpoy/fix-legacy-image-handler
Browse files Browse the repository at this point in the history
Fix legacy image handler bodyparam assignment
  • Loading branch information
julianpoy authored Dec 5, 2019
2 parents e45a61f + 616ca46 commit 9577508
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Backend/routes/recipes.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ const legacyImageHandler = async (req, res, next) => {
SubscriptionsService.CAPABILITIES.HIGH_RES_IMAGES
);

req.body.imageIds = req.body.imageIds || [];

const imageIds = req.body.imageIds;
const imageIds = req.body.imageIds || [];
await UtilService.upload('image', req, res);
if (req.file) {
const uploadedFile = req.file;
Expand All @@ -56,6 +54,8 @@ const legacyImageHandler = async (req, res, next) => {
imageIds.unshift(newImage.id);
}

req.body.imageIds = imageIds;

next();
};

Expand Down

0 comments on commit 9577508

Please sign in to comment.