1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-12-23 23:02:08 +03:00

Started work on hierachy conversion actions

- Updates book/shelf cover image handling for easier cloning/handling.
- Adds core logic for promoting books/chapters up a level.
- Enables usage of book/shelf cover image via API.

Related to #1087
This commit is contained in:
Dan Brown
2022-06-13 17:20:21 +01:00
parent 0a05119aa5
commit d676e1e824
10 changed files with 166 additions and 72 deletions

View File

@@ -91,6 +91,7 @@ class BookRepo
{
$book = new Book();
$this->baseRepo->create($book, $input);
$this->baseRepo->updateCoverImage($book, $input['image']);
Activity::add(ActivityType::BOOK_CREATE, $book);
return $book;
@@ -102,6 +103,11 @@ class BookRepo
public function update(Book $book, array $input): Book
{
$this->baseRepo->update($book, $input);
if (isset($input['image'])) {
$this->baseRepo->updateCoverImage($book, $input['image'], $input['image'] === null);
}
Activity::add(ActivityType::BOOK_UPDATE, $book);
return $book;