Properly fixed metric updating

// cc @jbrooksuk
This commit is contained in:
Graham Campbell
2016-06-07 11:11:17 +01:00
parent a0b9856d61
commit b64dd1e87e
2 changed files with 4 additions and 5 deletions

View File

@@ -88,7 +88,7 @@ final class UpdateMetricCommand
/**
* The order of which to place the metric in.
*
* @var int
* @var int|null
*/
public $order;
@@ -124,11 +124,11 @@ final class UpdateMetricCommand
* @param int $places
* @param int $default_view
* @param int $threshold
* @param int $order
* @param int|null $order
*
* @return void
*/
public function __construct(Metric $metric, $name, $suffix, $description, $default_value, $calc_type, $display_chart, $places, $default_view, $threshold, $order)
public function __construct(Metric $metric, $name, $suffix, $description, $default_value, $calc_type, $display_chart, $places, $default_view, $threshold, $order = null)
{
$this->metric = $metric;
$this->name = $name;

View File

@@ -153,8 +153,7 @@ class MetricController extends Controller
Binput::get('display_chart', null, false),
Binput::get('places', null, false),
Binput::get('default_view', null, false),
Binput::get('threshold', null, false),
null,
Binput::get('threshold', null, false)
));
} catch (ValidationException $e) {
return Redirect::route('dashboard.metrics.edit', ['id' => $metric->id])