mirror of
https://github.com/shlinkio/shlink.git
synced 2025-02-25 18:45:27 -06:00
Added redirects to the list of domains
This commit is contained in:
@@ -25,8 +25,6 @@ class ListDomainsAction extends AbstractRestAction
|
||||
$apiKey = AuthenticationMiddleware::apiKeyFromRequest($request);
|
||||
$domainItems = $this->domainService->listDomains($apiKey);
|
||||
|
||||
// TODO Support including not found redirects if requested via query param
|
||||
|
||||
return new JsonResponse([
|
||||
'domains' => [
|
||||
'data' => $domainItems,
|
||||
|
||||
@@ -31,30 +31,60 @@ class ListDomainsTest extends ApiTestCase
|
||||
[
|
||||
'domain' => 'doma.in',
|
||||
'isDefault' => true,
|
||||
'redirects' => [
|
||||
'baseUrlRedirect' => null,
|
||||
'regular404Redirect' => null,
|
||||
'invalidShortUrlRedirect' => null,
|
||||
],
|
||||
],
|
||||
[
|
||||
'domain' => 'detached-with-redirects.com',
|
||||
'isDefault' => false,
|
||||
'redirects' => [
|
||||
'baseUrlRedirect' => 'foo.com',
|
||||
'regular404Redirect' => 'bar.com',
|
||||
'invalidShortUrlRedirect' => null,
|
||||
],
|
||||
],
|
||||
[
|
||||
'domain' => 'example.com',
|
||||
'isDefault' => false,
|
||||
'redirects' => [
|
||||
'baseUrlRedirect' => null,
|
||||
'regular404Redirect' => null,
|
||||
'invalidShortUrlRedirect' => null,
|
||||
],
|
||||
],
|
||||
[
|
||||
'domain' => 'some-domain.com',
|
||||
'isDefault' => false,
|
||||
'redirects' => [
|
||||
'baseUrlRedirect' => null,
|
||||
'regular404Redirect' => null,
|
||||
'invalidShortUrlRedirect' => null,
|
||||
],
|
||||
],
|
||||
]];
|
||||
yield 'author API key' => ['author_api_key', [
|
||||
[
|
||||
'domain' => 'doma.in',
|
||||
'isDefault' => true,
|
||||
'redirects' => [
|
||||
'baseUrlRedirect' => null,
|
||||
'regular404Redirect' => null,
|
||||
'invalidShortUrlRedirect' => null,
|
||||
],
|
||||
],
|
||||
]];
|
||||
yield 'domain API key' => ['domain_api_key', [
|
||||
[
|
||||
'domain' => 'example.com',
|
||||
'isDefault' => false,
|
||||
'redirects' => [
|
||||
'baseUrlRedirect' => null,
|
||||
'regular404Redirect' => null,
|
||||
'invalidShortUrlRedirect' => null,
|
||||
],
|
||||
],
|
||||
]];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user