Updated DingoAPI to .7
Rename component.component to component_id with relationship name change Rename more instances of parent to component Working on Incident Repository Fix Incident seeder component_id is fillable within the model Fix bad relationship Finished Incident repository Added Metric repository Updated tests for new dingo release
This commit is contained in:
committed by
James Brooks
parent
692d2fc0fe
commit
b2e1d2750c
@@ -3,18 +3,17 @@
|
||||
namespace CachetHQ\Cachet\Controllers\Api;
|
||||
|
||||
use Input;
|
||||
use Dingo\Api\Routing\Controller as DingoController;
|
||||
use Dingo\Api\Auth\Shield;
|
||||
use Dingo\Api\Routing\ControllerTrait;
|
||||
use Illuminate\Routing\Controller;
|
||||
use CachetHQ\Cachet\Repositories\Component\ComponentRepository;
|
||||
|
||||
class ComponentController extends DingoController {
|
||||
class ComponentController extends Controller {
|
||||
|
||||
protected $auth;
|
||||
use ControllerTrait;
|
||||
|
||||
protected $component;
|
||||
|
||||
public function __construct(Shield $auth, ComponentRepository $component) {
|
||||
$this->auth = $auth;
|
||||
public function __construct(ComponentRepository $component) {
|
||||
$this->component = $component;
|
||||
}
|
||||
|
||||
@@ -38,6 +37,11 @@ class ComponentController extends DingoController {
|
||||
return $this->component->findOrFail($id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a component with incidents
|
||||
* @param [type] $id [description]
|
||||
* @return [type] [description]
|
||||
*/
|
||||
public function getComponentIncidents($id) {
|
||||
return $this->component->with($id, ['incidents']);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user