Prepared version 1.9.0

This commit is contained in:
Alejandro Celaya 2018-05-01 10:10:19 +02:00
parent e504daa1ba
commit 4fee656f96
2 changed files with 8 additions and 2 deletions

View file

@ -21,6 +21,12 @@ return [
'middleware' => Action\CreateShortcodeAction::class, 'middleware' => Action\CreateShortcodeAction::class,
'allowed_methods' => [RequestMethod::METHOD_POST], 'allowed_methods' => [RequestMethod::METHOD_POST],
], ],
// [
// 'name' => Action\CreateShortcodeAction::class,
// 'path' => '/short-codes',
// 'middleware' => Action\CreateShortcodeAction::class,
// 'allowed_methods' => [RequestMethod::METHOD_GET],
// ],
[ [
'name' => Action\EditShortCodeAction::class, 'name' => Action\EditShortCodeAction::class,
'path' => '/short-codes/{shortCode}', 'path' => '/short-codes/{shortCode}',

View file

@ -80,7 +80,7 @@ class CreateShortcodeAction extends AbstractRestAction
$this->logger->warning('Provided Invalid URL.' . PHP_EOL . $e); $this->logger->warning('Provided Invalid URL.' . PHP_EOL . $e);
return new JsonResponse([ return new JsonResponse([
'error' => RestUtils::getRestErrorCodeFromException($e), 'error' => RestUtils::getRestErrorCodeFromException($e),
'message' => sprintf( 'message' => \sprintf(
$this->translator->translate('Provided URL %s is invalid. Try with a different one.'), $this->translator->translate('Provided URL %s is invalid. Try with a different one.'),
$longUrl $longUrl
), ),
@ -89,7 +89,7 @@ class CreateShortcodeAction extends AbstractRestAction
$this->logger->warning('Provided non-unique slug.' . PHP_EOL . $e); $this->logger->warning('Provided non-unique slug.' . PHP_EOL . $e);
return new JsonResponse([ return new JsonResponse([
'error' => RestUtils::getRestErrorCodeFromException($e), 'error' => RestUtils::getRestErrorCodeFromException($e),
'message' => sprintf( 'message' => \sprintf(
$this->translator->translate('Provided slug %s is already in use. Try with a different one.'), $this->translator->translate('Provided slug %s is already in use. Try with a different one.'),
$customSlug $customSlug
), ),