Refactor validator stuff and fix variable names in views
This commit is contained in:
@@ -70,11 +70,7 @@ class MetricController extends AbstractApiController
|
||||
throw new BadRequestHttpException();
|
||||
}
|
||||
|
||||
if ($metric->isValid()) {
|
||||
return $this->item($metric);
|
||||
}
|
||||
|
||||
throw new BadRequestHttpException();
|
||||
return $this->item($metric);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -86,13 +82,13 @@ class MetricController extends AbstractApiController
|
||||
*/
|
||||
public function putMetric(Metric $metric)
|
||||
{
|
||||
$metric->update(Binput::all());
|
||||
|
||||
if ($metric->isValid('updating')) {
|
||||
return $this->item($metric);
|
||||
try {
|
||||
$metric->update(Binput::all());
|
||||
} catch (Exception $e) {
|
||||
throw new BadRequestHttpException();
|
||||
}
|
||||
|
||||
throw new BadRequestHttpException();
|
||||
return $this->item($metric);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user