mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-11 01:33:11 +08:00
Inlcuded tags as part of the ShortUrlMeta
This commit is contained in:
@@ -8,7 +8,7 @@ use Laminas\Diactoros\Response\JsonResponse;
|
||||
use Psr\Http\Message\ResponseInterface as Response;
|
||||
use Psr\Http\Message\ServerRequestInterface as Request;
|
||||
use Shlinkio\Shlink\Core\Exception\ValidationException;
|
||||
use Shlinkio\Shlink\Core\Model\CreateShortUrlData;
|
||||
use Shlinkio\Shlink\Core\Model\ShortUrlMeta;
|
||||
use Shlinkio\Shlink\Core\Service\UrlShortenerInterface;
|
||||
use Shlinkio\Shlink\Core\Transformer\ShortUrlDataTransformer;
|
||||
use Shlinkio\Shlink\Rest\Action\AbstractRestAction;
|
||||
@@ -26,11 +26,9 @@ abstract class AbstractCreateShortUrlAction extends AbstractRestAction
|
||||
|
||||
public function handle(Request $request): Response
|
||||
{
|
||||
$shortUrlData = $this->buildShortUrlData($request);
|
||||
$tags = $shortUrlData->getTags();
|
||||
$shortUrlMeta = $shortUrlData->getMeta();
|
||||
$shortUrlMeta = $this->buildShortUrlData($request);
|
||||
|
||||
$shortUrl = $this->urlShortener->shorten($tags, $shortUrlMeta);
|
||||
$shortUrl = $this->urlShortener->shorten($shortUrlMeta);
|
||||
$transformer = new ShortUrlDataTransformer($this->domainConfig);
|
||||
|
||||
return new JsonResponse($transformer->transform($shortUrl));
|
||||
@@ -39,5 +37,5 @@ abstract class AbstractCreateShortUrlAction extends AbstractRestAction
|
||||
/**
|
||||
* @throws ValidationException
|
||||
*/
|
||||
abstract protected function buildShortUrlData(Request $request): CreateShortUrlData;
|
||||
abstract protected function buildShortUrlData(Request $request): ShortUrlMeta;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user