diff --git a/src/js/components/full-post/models/full-post.model.js b/src/js/components/full-post/models/full-post.model.js index ec8c2c4..eeaadf3 100644 --- a/src/js/components/full-post/models/full-post.model.js +++ b/src/js/components/full-post/models/full-post.model.js @@ -86,6 +86,7 @@ function FullPostModel(PostsApi, TagsApi, CategoriesApi, $q, MediaApi, $FrontPre var categoryByIdPromise = CategoriesApi.getCategoryById(categoriesIds[i]); categoryByIdPromise.then(function(categoryResult){ + categoryResult = categoryResult.data; var category = {}; category.name = categoryResult.name; model.addCategory(category); @@ -104,6 +105,7 @@ function FullPostModel(PostsApi, TagsApi, CategoriesApi, $q, MediaApi, $FrontPre var tagByIdpromise = TagsApi.getTagById(tagsIds[j]); tagByIdpromise.then(function(tagResult){ + tagResult = tagResult.data; var tag = {}; tag.name = tagResult.name; model.addTag(tag); @@ -117,8 +119,9 @@ function FullPostModel(PostsApi, TagsApi, CategoriesApi, $q, MediaApi, $FrontPre var featuredImagesPromise = MediaApi.getMediaById(result.featured_media); - featuredImagesPromise.then(function(result){ - model.setFeaturedImage(result.source_url); + featuredImagesPromise.then(function(featuredImageResult){ + featuredImageResult = featuredImageResult.data; + model.setFeaturedImage(featuredImageResult.source_url); }); featuredImagesPromise.catch(function(error){ diff --git a/src/js/components/list-posts/models/list-posts.model.js b/src/js/components/list-posts/models/list-posts.model.js index 0bbdbed..c66a7ce 100644 --- a/src/js/components/list-posts/models/list-posts.model.js +++ b/src/js/components/list-posts/models/list-posts.model.js @@ -29,7 +29,7 @@ function ListPostsModel(PostsApi, MediaApi, $q, SlugsMapModel, ApiManager){ var featuredImagesPromise = MediaApi.getMediaById(featuredMediaId); featuredImagesPromise.then(function(result){ - defer.resolve(result); + defer.resolve(result.data); }); featuredImagesPromise.catch(function(error){