mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-06 23:33:13 +08:00
Added redirects to the list of domains
This commit is contained in:
@@ -28,6 +28,11 @@ final class NotFoundRedirects implements JsonSerializable
|
||||
return new self(null, null, null);
|
||||
}
|
||||
|
||||
public static function fromConfig(NotFoundRedirectConfigInterface $config): self
|
||||
{
|
||||
return new self($config->baseUrlRedirect(), $config->regular404Redirect(), $config->invalidShortUrlRedirect());
|
||||
}
|
||||
|
||||
public function baseUrlRedirect(): ?string
|
||||
{
|
||||
return $this->baseUrlRedirect;
|
||||
|
||||
@@ -6,6 +6,7 @@ namespace Shlinkio\Shlink\Core\Domain\Model;
|
||||
|
||||
use JsonSerializable;
|
||||
use Shlinkio\Shlink\Core\Config\NotFoundRedirectConfigInterface;
|
||||
use Shlinkio\Shlink\Core\Config\NotFoundRedirects;
|
||||
use Shlinkio\Shlink\Core\Entity\Domain;
|
||||
|
||||
final class DomainItem implements JsonSerializable
|
||||
@@ -32,6 +33,7 @@ final class DomainItem implements JsonSerializable
|
||||
return [
|
||||
'domain' => $this->authority,
|
||||
'isDefault' => $this->isDefault,
|
||||
'redirects' => NotFoundRedirects::fromConfig($this->notFoundRedirectConfig),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ declare(strict_types=1);
|
||||
namespace Shlinkio\Shlink\Core\Domain\Repository;
|
||||
|
||||
use Doctrine\ORM\Query\Expr\Join;
|
||||
use Doctrine\ORM\QueryBuilder;
|
||||
use Happyr\DoctrineSpecification\Repository\EntitySpecificationRepository;
|
||||
use Happyr\DoctrineSpecification\Spec;
|
||||
use Shlinkio\Shlink\Core\Domain\Spec\IsDomain;
|
||||
|
||||
Reference in New Issue
Block a user