Fix contact routes
This commit is contained in:
parent
14d8c12130
commit
53d13f4e4a
2 changed files with 17 additions and 3 deletions
|
@ -92,7 +92,19 @@ class Router
|
||||||
$this->routeCollector->addRoute(['GET'], '/bookmarklet', Module\Bookmarklet::class);
|
$this->routeCollector->addRoute(['GET'], '/bookmarklet', Module\Bookmarklet::class);
|
||||||
$this->routeCollector->addGroup('/contact', function (RouteCollector $collector) {
|
$this->routeCollector->addGroup('/contact', function (RouteCollector $collector) {
|
||||||
$collector->addRoute(['GET'], '[/]', Module\Contact::class);
|
$collector->addRoute(['GET'], '[/]', Module\Contact::class);
|
||||||
$collector->addRoute(['GET'], '/{id:\d+}[/posts|conversations]', Module\Contact::class);
|
$collector->addRoute(['GET'], '/{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);
|
||||||
|
$collector->addRoute(['GET'], '/{id:\d+}/drop', Module\Contact::class);
|
||||||
|
$collector->addRoute(['GET'], '/{id:\d+}/ignore', Module\Contact::class);
|
||||||
|
$collector->addRoute(['GET'], '/{id:\d+}/posts', Module\Contact::class);
|
||||||
|
$collector->addRoute(['GET'], '/{id:\d+}/update', Module\Contact::class);
|
||||||
|
$collector->addRoute(['GET'], '/all', Module\Contact::class);
|
||||||
|
$collector->addRoute(['GET'], '/archived', Module\Contact::class);
|
||||||
|
$collector->addRoute(['GET'], '/blocked', Module\Contact::class);
|
||||||
|
$collector->addRoute(['GET'], '/hidden', Module\Contact::class);
|
||||||
|
$collector->addRoute(['GET'], '/ignored', Module\Contact::class);
|
||||||
});
|
});
|
||||||
$this->routeCollector->addRoute(['GET'], '/credits', Module\Credits::class);
|
$this->routeCollector->addRoute(['GET'], '/credits', Module\Credits::class);
|
||||||
$this->routeCollector->addRoute(['GET'], '/directory', Module\Directory::class);
|
$this->routeCollector->addRoute(['GET'], '/directory', Module\Directory::class);
|
||||||
|
@ -122,8 +134,8 @@ class Router
|
||||||
$collector->addRoute(['GET', 'POST'], '/drop/{group:\d+}', Module\Group::class);
|
$collector->addRoute(['GET', 'POST'], '/drop/{group:\d+}', Module\Group::class);
|
||||||
$collector->addRoute(['GET', 'POST'], '/{group:\d+}/{contact:\d+}', Module\Group::class);
|
$collector->addRoute(['GET', 'POST'], '/{group:\d+}/{contact:\d+}', Module\Group::class);
|
||||||
|
|
||||||
$collector->addRoute(['POST'], '/{group:\d+}/add/{contact:\d+}', Module\Group::class);
|
$collector->addRoute(['GET', 'POST'], '/{group:\d+}/add/{contact:\d+}', Module\Group::class);
|
||||||
$collector->addRoute(['POST'], '/{group:\d+}/remove/{contact:\d+}', Module\Group::class);
|
$collector->addRoute(['GET', 'POST'], '/{group:\d+}/remove/{contact:\d+}', Module\Group::class);
|
||||||
});
|
});
|
||||||
$this->routeCollector->addRoute(['GET'], '/hashtag', Module\Hashtag::class);
|
$this->routeCollector->addRoute(['GET'], '/hashtag', Module\Hashtag::class);
|
||||||
$this->routeCollector->addRoute(['GET'], '/home', Module\Home::class);
|
$this->routeCollector->addRoute(['GET'], '/home', Module\Home::class);
|
||||||
|
|
|
@ -367,6 +367,7 @@ class Contact extends BaseModule
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @TODO: Replace with parameter from router
|
||||||
$cmd = $a->argv[2];
|
$cmd = $a->argv[2];
|
||||||
|
|
||||||
$orig_record = DBA::selectFirst('contact', [], ['id' => $contact_id, 'uid' => [0, local_user()], 'self' => false, 'deleted' => false]);
|
$orig_record = DBA::selectFirst('contact', [], ['id' => $contact_id, 'uid' => [0, local_user()], 'self' => false, 'deleted' => false]);
|
||||||
|
@ -667,6 +668,7 @@ class Contact extends BaseModule
|
||||||
$archived = false;
|
$archived = false;
|
||||||
$all = false;
|
$all = false;
|
||||||
|
|
||||||
|
// @TODO: Replace with parameter from router
|
||||||
if (($a->argc == 2) && ($a->argv[1] === 'all')) {
|
if (($a->argc == 2) && ($a->argv[1] === 'all')) {
|
||||||
$sql_extra = '';
|
$sql_extra = '';
|
||||||
$all = true;
|
$all = true;
|
||||||
|
|
Loading…
Reference in a new issue