From 9ff0d56e039c3516a0e916c3f53c88ef3de06142 Mon Sep 17 00:00:00 2001 From: Philipp Holzer Date: Tue, 7 May 2019 21:15:22 +0200 Subject: [PATCH] Add contact/batch route --- src/App/Router.php | 3 ++- src/Module/Contact.php | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/App/Router.php b/src/App/Router.php index 66fb24be1f..afea901cf6 100644 --- a/src/App/Router.php +++ b/src/App/Router.php @@ -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); diff --git a/src/Module/Contact.php b/src/Module/Contact.php index 42ae32db89..b1c37e21ad 100644 --- a/src/Module/Contact.php +++ b/src/Module/Contact.php @@ -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; -- 2.39.5