Add an endpoint to like posts

This commit is contained in:
Bat
2018-05-10 17:38:03 +01:00
parent ac7b4441e8
commit ee7dfee3ef
7 changed files with 79 additions and 4 deletions
+2 -1
View File
@@ -31,7 +31,8 @@ fn details(blog: String, slug: String, conn: DbConn) -> Template {
"content": c.content,
"author": c.get_author(&*conn)
})
}).collect::<Vec<serde_json::Value>>()
}).collect::<Vec<serde_json::Value>>(),
"n_likes": post.get_likes(&*conn).len()
}))
}