routes on files
This commit is contained in:
@@ -15,9 +15,7 @@ postDB = (DB)=>{
|
||||
const id = DB.ObjectID(postid);
|
||||
let update = {
|
||||
$set:{
|
||||
reactions:{
|
||||
[userid]: reaction
|
||||
},
|
||||
["reactions." + userid]: reaction,
|
||||
lastUpdated: new Date()
|
||||
}
|
||||
}
|
||||
@@ -80,7 +78,15 @@ postDB = (DB)=>{
|
||||
}
|
||||
|
||||
DB.getPosts = (userObj) => {
|
||||
return DB.postCols.find().toArray().catch((err)=>{
|
||||
return DB.postCols.find().sort({_id: -1}).toArray().catch((err)=>{
|
||||
console.log(err);
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
DB.getPostsOfUser = (userId) => {
|
||||
let userid = DB.ObjectID(userId);
|
||||
return DB.postCols.find({userid}).sort({_id: -1}).toArray().catch((err)=>{
|
||||
console.log(err);
|
||||
return false;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user