]> BookStack Code Mirror - bookstack/commitdiff
[API] add priority in book read
authorJean-René ROUET <redacted>
Mon, 12 Jun 2023 13:12:46 +0000 (15:12 +0200)
committerJean-René ROUET <redacted>
Mon, 12 Jun 2023 13:12:46 +0000 (15:12 +0200)
[API] add priority in chapter create and update
[API] add priority in page create and update

app/Api/ApiEntityListFormatter.php
app/Entities/Controllers/ChapterApiController.php
app/Entities/Controllers/PageApiController.php

index c170ecf0c9d51bf30b3fdb3b7ee270f936ef71a7..7d00834e5d1040c47eb56abe9c123674f4e683eb 100644 (file)
@@ -22,6 +22,7 @@ class ApiEntityListFormatter
     protected $fields = [
         'id', 'name', 'slug', 'book_id', 'chapter_id',
         'draft', 'template', 'created_at', 'updated_at',
+        'priority'
     ];
 
     public function __construct(array $list)
index 403c58de3c5a1a346c3e6f778a0b336c0ba1b23d..7f01e445a576d3d86cbbf097da50a09014472c44 100644 (file)
@@ -19,12 +19,14 @@ class ChapterApiController extends ApiController
             'name'        => ['required', 'string', 'max:255'],
             'description' => ['string', 'max:1000'],
             'tags'        => ['array'],
+            'priority'    => ['integer'],
         ],
         'update' => [
             'book_id'     => ['integer'],
             'name'        => ['string', 'min:1', 'max:255'],
             'description' => ['string', 'max:1000'],
             'tags'        => ['array'],
+            'priority'    => ['integer'],
         ],
     ];
 
index 28dd36f973e0d487f74bc6be8b0af30e3bf986c8..c83126df9736dd4164bd484d6e8b4c3b6c80fd2a 100644 (file)
@@ -23,6 +23,7 @@ class PageApiController extends ApiController
             'html'       => ['required_without:markdown', 'string'],
             'markdown'   => ['required_without:html', 'string'],
             'tags'       => ['array'],
+            'priority'   => ['integer'],
         ],
         'update' => [
             'book_id'    => ['integer'],
@@ -31,6 +32,7 @@ class PageApiController extends ApiController
             'html'       => ['string'],
             'markdown'   => ['string'],
             'tags'       => ['array'],
+            'priority'   => ['integer'],
         ],
     ];