post by user
This commit is contained in:
@@ -16,6 +16,12 @@ DB.getDB.then((DB)=>{
|
||||
return res.json(posts)
|
||||
});
|
||||
|
||||
router.get("/usr/:id", async (req, res) => {
|
||||
const userid = req.params.id;
|
||||
const posts = await DB.getPosts(userid);
|
||||
return res.json(posts)
|
||||
});
|
||||
|
||||
router.get("/new", async (req, res) => {
|
||||
let post = {
|
||||
userid: getUserId(req),
|
||||
@@ -46,7 +52,8 @@ DB.getDB.then((DB)=>{
|
||||
r = await DB.newComment(postid, comment);
|
||||
console.log(r)
|
||||
return res.json({
|
||||
status: "ok"
|
||||
status: "ok",
|
||||
...comment
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user