FIX: Some stream items don't have post_id, so expand by topic id / post number

This commit is contained in:
Robin Ward 2017-06-21 12:26:43 -04:00
parent 6796de8bf2
commit d09bed0d76
1 changed files with 3 additions and 1 deletions

View File

@ -10,8 +10,10 @@ export default Ember.Component.extend({
actions: { actions: {
expandItem() { expandItem() {
const item = this.get('item'); const item = this.get('item');
const topicId = item.get('topic_id');
const postNumber = item.get('post_number');
return ajax(`/posts/${item.get('post_id')}/cooked.json`).then(result => { return ajax(`/posts/by_number/${topicId}/${postNumber}.json`).then(result => {
item.set('truncated', false); item.set('truncated', false);
item.set('excerpt', result.cooked); item.set('excerpt', result.cooked);
}); });