1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-27 06:01:54 +03:00

Comments: Updated to show form in expected location

Includes a change of create response to use a branch as a template.
This commit is contained in:
Dan Brown
2023-06-08 15:03:38 +01:00
parent 154924cc0c
commit 3b46b92bb9
7 changed files with 68 additions and 51 deletions

View File

@ -10,11 +10,9 @@ use Illuminate\Validation\ValidationException;
class CommentController extends Controller
{
protected $commentRepo;
public function __construct(CommentRepo $commentRepo)
{
$this->commentRepo = $commentRepo;
public function __construct(
protected CommentRepo $commentRepo
) {
}
/**
@ -43,7 +41,12 @@ class CommentController extends Controller
$this->checkPermission('comment-create-all');
$comment = $this->commentRepo->create($page, $request->get('text'), $request->get('parent_id'));
return view('comments.comment', ['comment' => $comment]);
return view('comments.comment-branch', [
'branch' => [
'comment' => $comment,
'children' => [],
]
]);
}
/**