1
0
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:
Thomas Tanghus 2014-04-11 12:45:06 +02:00
parent 02cb4fdb86
commit bf37aead8e
2 changed files with 15 additions and 2 deletions

View File

@ -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

View File

@ -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');