Этот коммит содержится в:
hmhealey
2015-11-27 17:03:29 -05:00
родитель 4bc5ba9e50
Коммит 0e84ab440e

Просмотреть файл

@@ -39,6 +39,7 @@ class PostStoreClass extends EventEmitter {
this.makePostsInfo = this.makePostsInfo.bind(this);
this.getPost = this.getPost.bind(this);
this.getAllPosts = this.getAllPosts.bind(this);
this.getEarliestPost = this.getEarliestPost.bind(this);
this.getLatestPost = this.getLatestPost.bind(this);
@@ -160,6 +161,17 @@ class PostStoreClass extends EventEmitter {
}
}
getPost(channelId, postId) {
const posts = this.postsInfo[channelId].postList;
let post = null;
if (posts.posts.hasOwnProperty(postId)) {
post = Object.assign({}, posts.posts[postId]);
}
return post;
}
getAllPosts(id) {
if (this.postsInfo.hasOwnProperty(id)) {
return Object.assign({}, this.postsInfo[id].postList);