From 155a61c8671968faed29d43c5326bdfa80dbc253 Mon Sep 17 00:00:00 2001 From: Thomas Tanghus Date: Fri, 18 Oct 2013 15:29:16 +0200 Subject: [PATCH] Misc cleanup --- js/storage.js | 2 +- lib/app.php | 2 ++ lib/dispatcher.php | 13 +++---------- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/js/storage.js b/js/storage.js index af4cbad2..47b4a507 100644 --- a/js/storage.js +++ b/js/storage.js @@ -7,6 +7,7 @@ OC.Contacts = OC.Contacts || {}; this.getAllResponseHeaders = jqXHR.getAllResponseHeaders; this.getResponseHeader = jqXHR.getResponseHeader; this.statusCode = jqXHR.status; + this.error = false; // 204 == No content // 304 == Not modified if(!response) { @@ -29,7 +30,6 @@ OC.Contacts = OC.Contacts || {}; this.message = t('contacts', 'Server error! Please inform system administator'); } } else { - this.error = false; this.data = response; } } diff --git a/lib/app.php b/lib/app.php index c7814dcd..bef27332 100644 --- a/lib/app.php +++ b/lib/app.php @@ -19,6 +19,8 @@ use Sabre\VObject, /** * This class manages our app actions + * + * TODO: Merge in Dispatcher */ App::$l10n = \OC_L10N::get('contacts'); diff --git a/lib/dispatcher.php b/lib/dispatcher.php index 6766e39f..2b4dcef0 100644 --- a/lib/dispatcher.php +++ b/lib/dispatcher.php @@ -23,6 +23,8 @@ use OCP\AppFramework\App as MainApp, /** * This class manages our app actions + * + * TODO: Merge with App */ class Dispatcher extends MainApp { @@ -32,18 +34,9 @@ class Dispatcher extends MainApp { protected $app; public function __construct($params) { - parent::__construct('contacts'); + parent::__construct('contacts', $params); $this->container = $this->getContainer(); - $this->container['urlParams'] = $params; $this->container->registerMiddleware(new HttpMiddleware($this->container)); - // TODO: Remove this once sorted out. - // When querying the middleware dispatcher Request gets instantiated - // but urlParams isn't set yet - //$this->container['urlParams'] = $params; - //$this->middleware = $this->container->query('MiddlewareDispatcher'); - //$this->middleware->registerMiddleware(new HttpMiddleware($this->container->query('API'))); - //$this->api = $this->container->query('API'); - //$this->request = $this->container->query('Request'); $this->app = new App($this->container->query('API')->getUserId()); $this->registerServices(); }