Fix bugs with post creation API

This commit is contained in:
Toby Zerner 2015-01-30 12:21:33 +10:30
parent 5cd87db5cf
commit 02f5577c6f
2 changed files with 2 additions and 2 deletions

View File

@ -20,7 +20,7 @@ class Create extends Base
// the post content, and the author's user account. Let's set up a
// command with this information. We also fire an event to allow plugins
// to add data to the command.
$discussionId = $this->input('posts.links.discussions');
$discussionId = $this->input('posts.links.discussion');
$content = $this->input('posts.content');
$command = new PostReplyCommand($discussionId, $content, User::current());

View File

@ -15,7 +15,7 @@ class CommentPost extends Post
parent::boot();
static::saving(function ($post) {
$post->number = $post->discussion->number_index++;
$post->number = ++$post->discussion->number_index;
$post->discussion->save();
});
}