]> BookStack Code Mirror - bookstack/blobdiff - app/Http/Controllers/BookshelfController.php
Fixed some typos and corrected grammar.
[bookstack] / app / Http / Controllers / BookshelfController.php
index ce2e508c87518a162f980473b67babdcfaa53a9f..a294bf7318c2a35a44d42ff3772b15f900a5123d 100644 (file)
@@ -87,6 +87,7 @@ class BookshelfController extends Controller
             'name'        => ['required', 'string', 'max:255'],
             'description' => ['string', 'max:1000'],
             'image'       => array_merge(['nullable'], $this->getImageValidationRules()),
+            'tags'        => ['array'],
         ]);
 
         $bookIds = explode(',', $request->get('books', ''));
@@ -163,11 +164,12 @@ class BookshelfController extends Controller
             'name'        => ['required', 'string', 'max:255'],
             'description' => ['string', 'max:1000'],
             'image'       => array_merge(['nullable'], $this->getImageValidationRules()),
+            'tags'        => ['array'],
         ]);
 
         if ($request->has('image_reset')) {
             $validated['image'] = null;
-        } else if (is_null($validated['image'])) {
+        } elseif (array_key_exists('image', $validated) && is_null($validated['image'])) {
             unset($validated['image']);
         }