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

Commit c2ecee1

Browse files
committed
Closes 80 - Torna o slug opcional na rota de post
1 parent 64afcf0 commit c2ecee1

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/js/views/post/controllers/post-directive.controller.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,15 @@ function PostDirectiveController(FullPostModel, $stateParams, PageHeadModel, Slu
1616
break;
1717
}
1818

19-
var postId = JSON.search(cachedSlugs, "//*[slug='{0}']/{1}".format(postSlug, idProperty))[0];
19+
var postId;
20+
21+
if($stateParams.postId){
22+
postId = $stateParams.postId;
23+
}
24+
else {
25+
postId = JSON.search(cachedSlugs, "//*[slug='{0}']/{1}".format(postSlug, idProperty))[0];
26+
}
27+
2028

2129
var fullPostPromise = FullPostModel.loadFullPostById(postId);
2230

0 commit comments

Comments
 (0)