Created new repository method which will look for short URLs without doing domain fallback

This commit is contained in:
Alejandro Celaya
2020-02-02 12:44:35 +01:00
parent e87d4d61bc
commit 10f79ec01d
5 changed files with 67 additions and 23 deletions

View File

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