move to the right forum topic page after creating a post
This commit is contained in:
parent
4880ffc66b
commit
924d0659c9
|
@ -24,7 +24,10 @@ object ForumPost extends LilaController with forum.Controller {
|
|||
data ⇒ (for {
|
||||
post ← postApi.makePost(categ, topic, data, ctx.me)
|
||||
} yield Redirect("%s#%d".format(
|
||||
routes.ForumTopic.show(categ.slug, topic.slug, postApi lastPageOf topic),
|
||||
routes.ForumTopic.show(
|
||||
categ.slug,
|
||||
topic.slug,
|
||||
postApi lastPageOf topic.incNbPosts),
|
||||
post.number)
|
||||
)).unsafePerformIO
|
||||
)
|
||||
|
|
|
@ -15,6 +15,8 @@ case class Topic(
|
|||
updatedAt: DateTime,
|
||||
nbPosts: Int = 0,
|
||||
lastPostId: String = "") {
|
||||
|
||||
def incNbPosts = copy(nbPosts = nbPosts + 1)
|
||||
}
|
||||
|
||||
object Topic {
|
||||
|
|
Loading…
Reference in a new issue