mirror of
https://github.com/flarum/core.git
synced 2025-10-09 22:16:51 +02:00
Convert the rest of the API to new action architecture
Also make some tweaks: - Merge SerializeAction::$include and SerializeAction::$includeAvailable into a keyed boolean array - Set defaults for SerializeAction::$limit and $limitMax - Rename SerializeAction::$sortAvailable to $sortFields
This commit is contained in:
@@ -32,14 +32,21 @@ class CreateAction extends BaseCreateAction
|
||||
public static $serializer = 'Flarum\Api\Serializers\DiscussionSerializer';
|
||||
|
||||
/**
|
||||
* The relations that are included by default.
|
||||
* The relationships that are available to be included, and which ones are
|
||||
* included by default.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $include = ['posts', 'startUser', 'lastUser', 'startPost', 'lastPost'];
|
||||
public static $include = [
|
||||
'posts' => true,
|
||||
'startUser' => true,
|
||||
'lastUser' => true,
|
||||
'startPost' => true,
|
||||
'lastPost' => true
|
||||
];
|
||||
|
||||
/**
|
||||
* Initialize the action.
|
||||
* Instantiate the action.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Bus\Dispatcher $bus
|
||||
* @param \Flarum\Core\Models\Forum $forum
|
||||
|
Reference in New Issue
Block a user