Skip to content

Commit

Permalink
Route controller store method fix
Browse files Browse the repository at this point in the history
  • Loading branch information
PSkierniewski committed May 17, 2015
1 parent fbe77c7 commit 4f086ad
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Gzero/Api/Controller/Admin/RouteController.php
Expand Up @@ -55,11 +55,11 @@ public function __construct(UrlParamsProcessor $processor, ContentRepository $co
*/
public function store($contentId)
{
$content = $this->getContent($contentId);
$content = $this->repository->getById($contentId);
if (!empty($content)) {
if ($content->type != 'category') {
$input = $this->validator->validate('create');
$route = $this->repository->createRoute($input['langCode'], $input['url']);
$route = $this->repository->createRoute($content, $input['langCode'], $input['url']);
return $this->respondWithSuccess($route, new RouteTransformer);
} else {
// TODO categories children route update
Expand Down

0 comments on commit 4f086ad

Please sign in to comment.