limit number of reports on a post

merge-requests/208/head
fatchan 5 years ago
parent 6d7d71cbb6
commit 59f57da145
  1. 5
      models/forms/report-post.js

@ -15,7 +15,10 @@ module.exports = (req, posts) => {
message: `Reported ${posts.length} post(s)`,
action: '$push',
query: {
'reports': report
'reports': {
'$each': [report],
'$slice': -5 //limit number of reports
}
}
};

Loading…
Cancel
Save