Fixed tag edit not rendering example posts

This commit is contained in:
Marcin Kurczewski 2014-10-14 22:55:39 +02:00
parent 6209cc7833
commit 1e745fa648

View file

@ -19,6 +19,7 @@ App.Presenters.TagPresenter = function(
var tag;
var tagName;
var posts;
var privileges = {};
@ -52,7 +53,7 @@ App.Presenters.TagPresenter = function(
api.get('posts', {query: tagName}))
.then(function(tagResponse, postsResponse) {
tag = tagResponse.json;
var posts = postsResponse.json.data;
posts = postsResponse.json.data;
posts = posts.slice(0, 8);
render();
@ -84,7 +85,7 @@ App.Presenters.TagPresenter = function(
.then(function(response) {
tag = response.json;
render();
router.navigate('#/tag/' + tag.name);
renderPosts(posts);
}).fail(function(response) {
console.log(response);
window.alert('An error occurred');