mirror of
https://github.com/shlinkio/shlink.git
synced 2025-02-25 18:45:27 -06:00
Updated short URL deletion so that it accepts the domain
This commit is contained in:
@@ -8,6 +8,7 @@ use Laminas\Diactoros\Response\EmptyResponse;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Shlinkio\Shlink\Core\Model\ShortUrlIdentifier;
|
||||
use Shlinkio\Shlink\Core\Service\ShortUrl\DeleteShortUrlServiceInterface;
|
||||
use Shlinkio\Shlink\Rest\Action\AbstractRestAction;
|
||||
|
||||
@@ -26,8 +27,8 @@ class DeleteShortUrlAction extends AbstractRestAction
|
||||
|
||||
public function handle(ServerRequestInterface $request): ResponseInterface
|
||||
{
|
||||
$shortCode = $request->getAttribute('shortCode', '');
|
||||
$this->deleteShortUrlService->deleteByShortCode($shortCode);
|
||||
$identifier = ShortUrlIdentifier::fromApiRequest($request);
|
||||
$this->deleteShortUrlService->deleteByShortCode($identifier);
|
||||
return new EmptyResponse();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user