mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-11-06 00:50:36 +03:00
API: Added comment tree to pages-read endpoint
Includes tests to cover
This commit is contained in:
@@ -13,6 +13,11 @@ class CommentFactory extends Factory
|
||||
*/
|
||||
protected $model = \BookStack\Activity\Models\Comment::class;
|
||||
|
||||
/**
|
||||
* A static counter to provide a unique local_id for each comment.
|
||||
*/
|
||||
protected static int $nextLocalId = 1000;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
@@ -22,11 +27,12 @@ class CommentFactory extends Factory
|
||||
{
|
||||
$text = $this->faker->paragraph(1);
|
||||
$html = '<p>' . $text . '</p>';
|
||||
$nextLocalId = static::$nextLocalId++;
|
||||
|
||||
return [
|
||||
'html' => $html,
|
||||
'parent_id' => null,
|
||||
'local_id' => 1,
|
||||
'local_id' => $nextLocalId,
|
||||
'content_ref' => '',
|
||||
'archived' => false,
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user