Resolve conflicts

This commit is contained in:
syuilo 2018-03-29 14:48:47 +09:00
parent 281b388e39
commit bfc193d8cd
308 changed files with 3045 additions and 3200 deletions

View file

@ -23,22 +23,22 @@ module.exports = (params, user) => new Promise(async (res, rej) => {
// Get votes
const votes = await Vote.find({
user_id: user._id
userId: user._id
}, {
fields: {
_id: false,
post_id: true
postId: true
}
});
const nin = votes && votes.length != 0 ? votes.map(v => v.post_id) : [];
const nin = votes && votes.length != 0 ? votes.map(v => v.postId) : [];
const posts = await Post
.find({
_id: {
$nin: nin
},
user_id: {
userId: {
$ne: user._id
},
poll: {