]> git.mxchange.org Git - friendica.git/commitdiff
Add contact/batch route
authorPhilipp Holzer <admin@philipp.info>
Tue, 7 May 2019 19:15:22 +0000 (21:15 +0200)
committerPhilipp Holzer <admin@philipp.info>
Tue, 7 May 2019 19:15:22 +0000 (21:15 +0200)
src/App/Router.php
src/Module/Contact.php

index 66fb24be1fce64b0f6cfb930c100bcd41a1fc38e..afea901cf6c75c4e295f12ce6feb8ef41f8718c5 100644 (file)
@@ -92,7 +92,7 @@ class Router
                $this->routeCollector->addRoute(['GET'],         '/bookmarklet',         Module\Bookmarklet::class);
                $this->routeCollector->addGroup('/contact', function (RouteCollector $collector) {
                        $collector->addRoute(['GET'], '[/]',                                 Module\Contact::class);
-                       $collector->addRoute(['GET'], '/{id:\d+}[/]',                        Module\Contact::class);
+                       $collector->addRoute(['GET', 'POST'], '/{id:\d+}[/]',                Module\Contact::class);
                        $collector->addRoute(['GET'], '/{id:\d+}/archive',                   Module\Contact::class);
                        $collector->addRoute(['GET'], '/{id:\d+}/block',                     Module\Contact::class);
                        $collector->addRoute(['GET'], '/{id:\d+}/conversations',             Module\Contact::class);
@@ -103,6 +103,7 @@ class Router
                        $collector->addRoute(['GET'], '/{id:\d+}/updateprofile',             Module\Contact::class);
                        $collector->addRoute(['GET'], '/all',                                Module\Contact::class);
                        $collector->addRoute(['GET'], '/archived',                           Module\Contact::class);
+                       $collector->addRoute(['GET', 'POST'], '/batch',                      Module\Contact::class);
                        $collector->addRoute(['GET'], '/blocked',                            Module\Contact::class);
                        $collector->addRoute(['GET'], '/hidden',                             Module\Contact::class);
                        $collector->addRoute(['GET'], '/ignored',                            Module\Contact::class);
index 42ae32db892da0f90722a5e6257b950db03b3db5..b1c37e21ad0d922fc3f43da1cb3f8bc7a3f44e3c 100644 (file)
@@ -177,11 +177,13 @@ class Contact extends BaseModule
                        return;
                }
 
+               // @TODO: Replace with parameter from router
                if ($a->argv[1] === 'batch') {
                        self::batchActions($a);
                        return;
                }
 
+               // @TODO: Replace with parameter from router
                $contact_id = intval($a->argv[1]);
                if (!$contact_id) {
                        return;