/**
* Create a new shelf in the system.
*/
- public function update(Bookshelf $shelf, array $input, array $bookIds): Bookshelf
+ public function update(Bookshelf $shelf, array $input, ?array $bookIds): Bookshelf
{
$this->baseRepo->update($shelf, $input);
- $this->updateBooks($shelf, $bookIds);
+
+ if (!is_null($bookIds)) {
+ $this->updateBooks($shelf, $bookIds);
+ }
+
return $shelf;
}