mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-11 17:44:44 +08:00
Added logic to persist device long URLs while creating/editing a short URL
This commit is contained in:
@@ -51,7 +51,7 @@ class DomainService implements DomainServiceInterface
|
||||
$repo = $this->em->getRepository(Domain::class);
|
||||
$groups = group(
|
||||
$repo->findDomains($apiKey),
|
||||
fn (Domain $domain) => $domain->getAuthority() === $this->defaultDomain ? 'default' : 'domains',
|
||||
fn (Domain $domain) => $domain->authority() === $this->defaultDomain ? 'default' : 'domains',
|
||||
);
|
||||
|
||||
return [first($groups['default'] ?? []), $groups['domains'] ?? []];
|
||||
|
||||
@@ -24,14 +24,14 @@ class Domain extends AbstractEntity implements JsonSerializable, NotFoundRedirec
|
||||
return new self($authority);
|
||||
}
|
||||
|
||||
public function getAuthority(): string
|
||||
public function authority(): string
|
||||
{
|
||||
return $this->authority;
|
||||
}
|
||||
|
||||
public function jsonSerialize(): string
|
||||
{
|
||||
return $this->getAuthority();
|
||||
return $this->authority;
|
||||
}
|
||||
|
||||
public function invalidShortUrlRedirect(): ?string
|
||||
|
||||
@@ -20,7 +20,7 @@ final class DomainItem implements JsonSerializable
|
||||
|
||||
public static function forNonDefaultDomain(Domain $domain): self
|
||||
{
|
||||
return new self($domain->getAuthority(), $domain, false);
|
||||
return new self($domain->authority(), $domain, false);
|
||||
}
|
||||
|
||||
public static function forDefaultDomain(string $defaultDomain, NotFoundRedirectConfigInterface $config): self
|
||||
|
||||
Reference in New Issue
Block a user