mirror of https://gitgud.io/fatchan/jschan.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
321 B
24 lines
321 B
6 years ago
|
'use strict';
|
||
|
|
||
5 years ago
|
module.exports = (posts) => {
|
||
6 years ago
|
|
||
5 years ago
|
const filteredposts = posts.filter(post => {
|
||
|
return post.reports.length > 0
|
||
|
})
|
||
6 years ago
|
|
||
5 years ago
|
if (filteredposts.length === 0) {
|
||
|
return {
|
||
|
message: 'No report(s) to dismiss'
|
||
|
}
|
||
|
}
|
||
6 years ago
|
|
||
5 years ago
|
return {
|
||
|
message: 'Dismissed reports',
|
||
|
action: '$set',
|
||
|
query: {
|
||
|
'reports': []
|
||
|
}
|
||
|
};
|
||
6 years ago
|
|
||
|
}
|