Merge pull request #7115 from nupplaphil/bug/mod_contact_batch

Add contact/batch route
2022.09-rc
Hypolite Petovan 2019-05-07 15:22:46 -04:00 zatwierdzone przez GitHub
commit dcd602d02a
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 4 dodań i 1 usunięć

Wyświetl plik

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

Wyświetl plik

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