mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-06 23:33:13 +08:00
Refactored short URL creation so that the long URL is part of the ShortUrlMeta
This commit is contained in:
@@ -27,11 +27,10 @@ abstract class AbstractCreateShortUrlAction extends AbstractRestAction
|
||||
public function handle(Request $request): Response
|
||||
{
|
||||
$shortUrlData = $this->buildShortUrlData($request);
|
||||
$longUrl = $shortUrlData->getLongUrl();
|
||||
$tags = $shortUrlData->getTags();
|
||||
$shortUrlMeta = $shortUrlData->getMeta();
|
||||
|
||||
$shortUrl = $this->urlShortener->shorten($longUrl, $tags, $shortUrlMeta);
|
||||
$shortUrl = $this->urlShortener->shorten($tags, $shortUrlMeta);
|
||||
$transformer = new ShortUrlDataTransformer($this->domainConfig);
|
||||
|
||||
return new JsonResponse($transformer->transform($shortUrl));
|
||||
|
||||
Reference in New Issue
Block a user