mirror of
https://github.com/flarum/framework.git
synced 2024-12-02 23:23:52 +08:00
Assign user input to data property on EditDiscussionCommand
This commit is contained in:
parent
0582d8e60f
commit
963273575f
|
@ -6,11 +6,12 @@ class EditDiscussionCommand
|
|||
|
||||
public $user;
|
||||
|
||||
public $title;
|
||||
public $data;
|
||||
|
||||
public function __construct($discussionId, $user)
|
||||
public function __construct($discussionId, $user, $data)
|
||||
{
|
||||
$this->discussionId = $discussionId;
|
||||
$this->user = $user;
|
||||
$this->data = $data;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,8 +22,8 @@ class EditDiscussionCommandHandler
|
|||
|
||||
$discussion->assertCan($user, 'edit');
|
||||
|
||||
if (isset($command->title)) {
|
||||
$discussion->rename($command->title, $user);
|
||||
if (isset($command->data['title'])) {
|
||||
$discussion->rename($command->data['title'], $user);
|
||||
}
|
||||
|
||||
event(new DiscussionWillBeSaved($discussion, $command));
|
||||
|
|
Loading…
Reference in New Issue
Block a user