mirror of
https://github.com/flarum/framework.git
synced 2024-11-23 10:32:44 +08:00
Fix bugs with post creation API
This commit is contained in:
parent
c2feae406d
commit
edce73d6e9
|
@ -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