mirror of
https://github.com/flarum/core.git
synced 2025-08-01 22:20:21 +02:00
Fix bugs with post creation API
This commit is contained in:
@@ -20,7 +20,7 @@ class Create extends Base
|
|||||||
// the post content, and the author's user account. Let's set up a
|
// 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
|
// command with this information. We also fire an event to allow plugins
|
||||||
// to add data to the command.
|
// to add data to the command.
|
||||||
$discussionId = $this->input('posts.links.discussions');
|
$discussionId = $this->input('posts.links.discussion');
|
||||||
$content = $this->input('posts.content');
|
$content = $this->input('posts.content');
|
||||||
$command = new PostReplyCommand($discussionId, $content, User::current());
|
$command = new PostReplyCommand($discussionId, $content, User::current());
|
||||||
|
|
||||||
|
@@ -15,7 +15,7 @@ class CommentPost extends Post
|
|||||||
parent::boot();
|
parent::boot();
|
||||||
|
|
||||||
static::saving(function ($post) {
|
static::saving(function ($post) {
|
||||||
$post->number = $post->discussion->number_index++;
|
$post->number = ++$post->discussion->number_index;
|
||||||
$post->discussion->save();
|
$post->discussion->save();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user