Capture error on real-time update when creating short URL

This commit is contained in:
Alejandro Celaya
2023-04-12 09:15:36 +02:00
parent 33911afcd6
commit f078d95588
9 changed files with 71 additions and 19 deletions

View File

@@ -26,9 +26,9 @@ abstract class AbstractCreateShortUrlAction extends AbstractRestAction
public function handle(Request $request): Response
{
$shortUrlMeta = $this->buildShortUrlData($request);
$shortUrl = $this->urlShortener->shorten($shortUrlMeta);
$result = $this->urlShortener->shorten($shortUrlMeta);
return new JsonResponse($this->transformer->transform($shortUrl));
return new JsonResponse($this->transformer->transform($result->shortUrl));
}
/**