Deprecated action and endpoint to edit short URL tags

This commit is contained in:
Alejandro Celaya
2021-01-31 12:24:26 +01:00
parent 977058d219
commit cdfd14e63f
7 changed files with 18 additions and 51 deletions

View File

@@ -16,14 +16,11 @@ use Shlinkio\Shlink\Core\Paginator\Adapter\ShortUrlRepositoryAdapter;
use Shlinkio\Shlink\Core\Repository\ShortUrlRepository;
use Shlinkio\Shlink\Core\Service\ShortUrl\ShortUrlResolverInterface;
use Shlinkio\Shlink\Core\ShortUrl\Resolver\ShortUrlRelationResolverInterface;
use Shlinkio\Shlink\Core\Util\TagManagerTrait;
use Shlinkio\Shlink\Core\Util\UrlValidatorInterface;
use Shlinkio\Shlink\Rest\Entity\ApiKey;
class ShortUrlService implements ShortUrlServiceInterface
{
use TagManagerTrait;
private ORM\EntityManagerInterface $em;
private ShortUrlResolverInterface $urlResolver;
private UrlValidatorInterface $urlValidator;
@@ -55,21 +52,6 @@ class ShortUrlService implements ShortUrlServiceInterface
return $paginator;
}
/**
* @param string[] $tags
* @deprecated Use updateShortUrl instead
* @throws ShortUrlNotFoundException
*/
public function setTagsByShortCode(ShortUrlIdentifier $identifier, array $tags, ?ApiKey $apiKey = null): ShortUrl
{
$shortUrl = $this->urlResolver->resolveShortUrl($identifier, $apiKey);
$shortUrl->setTags($this->tagNamesToEntities($this->em, $tags));
$this->em->flush();
return $shortUrl;
}
/**
* @throws ShortUrlNotFoundException
* @throws InvalidUrlException

View File

@@ -20,13 +20,6 @@ interface ShortUrlServiceInterface
*/
public function listShortUrls(ShortUrlsParams $params, ?ApiKey $apiKey = null): Paginator;
/**
* @param string[] $tags
* @deprecated Use updateShortUrl instead
* @throws ShortUrlNotFoundException
*/
public function setTagsByShortCode(ShortUrlIdentifier $identifier, array $tags, ?ApiKey $apiKey = null): ShortUrl;
/**
* @throws ShortUrlNotFoundException
* @throws InvalidUrlException