'book_id' => $firstChapter->book->id,
'priority' => $firstChapter->priority,
'book_slug' => $firstChapter->book->slug,
+ 'owned_by' => $firstChapter->owned_by,
+ 'created_by' => $firstChapter->created_by,
+ 'updated_by' => $firstChapter->updated_by,
],
]]);
}
{
$this->actingAsApiEditor();
$book = $this->entities->book();
+ $templatePage = $this->entities->templatePage();
$details = [
'name' => 'My API chapter',
'description' => 'A chapter created via the API',
],
],
'priority' => 15,
+ 'default_template_id' => $templatePage->id,
];
$resp = $this->postJson($this->baseEndpoint, $details);
'id' => $page->id,
'slug' => $page->slug,
'name' => $page->name,
+ 'owned_by' => $page->owned_by,
+ 'created_by' => $page->created_by,
+ 'updated_by' => $page->updated_by,
+ 'book_id' => $page->id,
+ 'chapter_id' => $chapter->id,
+ 'priority' => $page->priority,
+ 'book_slug' => $chapter->book->slug,
+ 'draft' => $page->draft,
+ 'template' => $page->template,
+ 'editor' => $page->editor,
],
],
+ 'default_template_id' => null,
]);
$resp->assertJsonMissingPath('book');
$resp->assertJsonCount($chapter->pages()->count(), 'pages');
{
$this->actingAsApiEditor();
$chapter = $this->entities->chapter();
+ $templatePage = $this->entities->templatePage();
$details = [
'name' => 'My updated API chapter',
'description' => 'A chapter updated via the API',
],
],
'priority' => 15,
+ 'default_template_id' => $templatePage->id,
];
$resp = $this->putJson($this->baseEndpoint . "/{$chapter->id}", $details);