mirror of
https://github.com/owncloudarchive/contacts.git
synced 2025-01-18 07:52:21 +01:00
Inject API in AddressBookController. Refs. #460
This commit is contained in:
parent
02cb4fdb86
commit
bf37aead8e
@ -13,13 +13,25 @@ use OCA\Contacts\App,
|
||||
OCA\Contacts\JSONResponse,
|
||||
OCA\Contacts\Utils\JSONSerializer,
|
||||
OCA\Contacts\Controller,
|
||||
OCP\AppFramework\Http;
|
||||
OCP\AppFramework\Http,
|
||||
OCP\AppFramework\IApi,
|
||||
OCP\IRequest;
|
||||
|
||||
/**
|
||||
* Controller class For Address Books
|
||||
*/
|
||||
class AddressBookController extends Controller {
|
||||
|
||||
/**
|
||||
* @var \OCP\AppFramework\IApi
|
||||
*/
|
||||
protected $api;
|
||||
|
||||
public function __construct($appName, IRequest $request, App $app, IApi $api) {
|
||||
parent::__construct($appName, $request, $app);
|
||||
$this->api = $api;
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @NoCSRFRequired
|
||||
|
@ -74,7 +74,8 @@ class Dispatcher extends MainApp {
|
||||
});
|
||||
$this->container->registerService('AddressBookController', function(IAppContainer $container) use($app) {
|
||||
$request = $container->query('Request');
|
||||
return new AddressBookController($this->appName, $request, $app);
|
||||
$api = $container->query('API');
|
||||
return new AddressBookController($this->appName, $request, $app, $api);
|
||||
});
|
||||
$this->container->registerService('GroupController', function(IAppContainer $container) use($app) {
|
||||
$request = $container->query('Request');
|
||||
|
Loading…
x
Reference in New Issue
Block a user