FIX: Some stream items don't have post_id, so expand by topic id / post number
This commit is contained in:
parent
6796de8bf2
commit
d09bed0d76
|
@ -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);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue