Refactored method in ShortUrlsRepository

This commit is contained in:
Alejandro Celaya
2022-01-17 20:21:35 +01:00
parent 661b07e12f
commit dc430bae10
6 changed files with 31 additions and 20 deletions

View File

@@ -39,7 +39,7 @@ class ShortUrlResolver implements ShortUrlResolverInterface
{
/** @var ShortUrlRepository $shortUrlRepo */
$shortUrlRepo = $this->em->getRepository(ShortUrl::class);
$shortUrl = $shortUrlRepo->findOneWithDomainFallback($identifier->shortCode(), $identifier->domain());
$shortUrl = $shortUrlRepo->findOneWithDomainFallback($identifier);
if (! $shortUrl?->isEnabled()) {
throw ShortUrlNotFoundException::fromNotFound($identifier);
}