Fixes API sorting and filtering. Closes #1489
This commit is contained in:
committed by
James Brooks
parent
98550c31c9
commit
919c7127e7
+15
-1
@@ -12,13 +12,14 @@
|
||||
namespace CachetHQ\Cachet\Models;
|
||||
|
||||
use AltThree\Validator\ValidatingTrait;
|
||||
use CachetHQ\Cachet\Models\Traits\SortableTrait;
|
||||
use CachetHQ\Cachet\Presenters\MetricPresenter;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use McCool\LaravelAutoPresenter\HasPresenter;
|
||||
|
||||
class Metric extends Model implements HasPresenter
|
||||
{
|
||||
use ValidatingTrait;
|
||||
use SortableTrait, ValidatingTrait;
|
||||
|
||||
/**
|
||||
* The calculation type of sum.
|
||||
@@ -92,6 +93,19 @@ class Metric extends Model implements HasPresenter
|
||||
'default_view' => 'numeric|between:0,3',
|
||||
];
|
||||
|
||||
/**
|
||||
* The sortable fields.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected $sortable = [
|
||||
'id',
|
||||
'name',
|
||||
'display_chart',
|
||||
'default_value',
|
||||
'calc_type',
|
||||
];
|
||||
|
||||
/**
|
||||
* Metrics contain many metric points.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user