Skip to content
Snippets Groups Projects
Commit 7303aee2 authored by Sebastian Mihalache's avatar Sebastian Mihalache
Browse files

fix post

parent b0b9289b
No related branches found
No related tags found
1 merge request!8Sprint #10
......@@ -32,10 +32,10 @@ module.exports = models => async (req, res) => {
updatedOn: Date.now(),
recommendationType,
}
if (recommendation && comments) {
newRecommendation.recommendation = recommendation
newRecommendation.comments = comments
}
newRecommendation.recommendation = recommendation || undefined
newRecommendation.comments = comments || undefined
fragment.recommendations.push(newRecommendation)
await fragment.save()
return res.status(200).json(newRecommendation)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment