Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Commit

Permalink
Closes 80 - Torna o slug opcional na rota de post
Browse files Browse the repository at this point in the history
  • Loading branch information
teles committed Nov 15, 2016
1 parent 64afcf0 commit c2ecee1
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/js/views/post/controllers/post-directive.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,15 @@ function PostDirectiveController(FullPostModel, $stateParams, PageHeadModel, Slu
break;
}

var postId = JSON.search(cachedSlugs, "//*[slug='{0}']/{1}".format(postSlug, idProperty))[0];
var postId;

if($stateParams.postId){
postId = $stateParams.postId;
}
else {
postId = JSON.search(cachedSlugs, "//*[slug='{0}']/{1}".format(postSlug, idProperty))[0];
}


var fullPostPromise = FullPostModel.loadFullPostById(postId);

Expand Down

0 comments on commit c2ecee1

Please sign in to comment.