diff --git a/client/js/models/info.js b/client/js/models/info.js index ad44f580..d3ea505d 100644 --- a/client/js/models/info.js +++ b/client/js/models/info.js @@ -7,11 +7,14 @@ class Info { static get() { return api.get('/info') .then(response => { - if (response.featuredPost) { - response.featuredPost = - Post.fromResponse(response.featuredPost); - } - return Promise.resolve(response); + return Promise.resolve(Object.assign( + {}, + response, + { + featuredPost: response.featuredPost ? + Post.fromResponse(response.featuredPost) : + undefined + })); }, response => { return Promise.reject(response.errorMessage); }); diff --git a/client/js/models/tag_list.js b/client/js/models/tag_list.js index acd70d59..ec578bbf 100644 --- a/client/js/models/tag_list.js +++ b/client/js/models/tag_list.js @@ -12,8 +12,10 @@ class TagList extends AbstractList { `&pageSize=${pageSize}` + `&fields=${fields.join(',')}`; return api.get(url).then(response => { - response.results = TagList.fromResponse(response.results); - return Promise.resolve(response); + return Promise.resolve(Object.assign( + {}, + response, + {results: TagList.fromResponse(response.results)})); }); } }