diff --git a/module/Rest/config/routes.config.php b/module/Rest/config/routes.config.php index a1bd8dca..28b7cf5f 100644 --- a/module/Rest/config/routes.config.php +++ b/module/Rest/config/routes.config.php @@ -21,6 +21,12 @@ return [ 'middleware' => Action\CreateShortcodeAction::class, '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, 'path' => '/short-codes/{shortCode}', diff --git a/module/Rest/src/Action/CreateShortcodeAction.php b/module/Rest/src/Action/CreateShortcodeAction.php index b3c093d3..d880d552 100644 --- a/module/Rest/src/Action/CreateShortcodeAction.php +++ b/module/Rest/src/Action/CreateShortcodeAction.php @@ -80,7 +80,7 @@ class CreateShortcodeAction extends AbstractRestAction $this->logger->warning('Provided Invalid URL.' . PHP_EOL . $e); return new JsonResponse([ 'error' => RestUtils::getRestErrorCodeFromException($e), - 'message' => sprintf( + 'message' => \sprintf( $this->translator->translate('Provided URL %s is invalid. Try with a different one.'), $longUrl ), @@ -89,7 +89,7 @@ class CreateShortcodeAction extends AbstractRestAction $this->logger->warning('Provided non-unique slug.' . PHP_EOL . $e); return new JsonResponse([ 'error' => RestUtils::getRestErrorCodeFromException($e), - 'message' => sprintf( + 'message' => \sprintf( $this->translator->translate('Provided slug %s is already in use. Try with a different one.'), $customSlug ),