mirror of
https://github.com/flarum/framework.git
synced 2024-11-23 06:31:41 +08:00
Fix bugs with post creation API
This commit is contained in:
parent
5cd87db5cf
commit
02f5577c6f
|
@ -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());
|
||||
|
||||
|
|
|
@ -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();
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user