Ghost/ghost/admin/app/components/gh-posts-list-item.js
Kevin Ansfield 1f87c59055 Refactored <GhPostsListItem>
no issue

- moved `primaryTag` CP into the post model as per `primaryAuthor`
- removed all unnecessary or unused CPs in the component's backing class
- switched to using `@post` for direct argument access rather than `this.post`
2020-07-01 20:37:46 +01:00

17 lines
478 B
JavaScript

import Component from '@ember/component';
import {computed} from '@ember/object';
import {inject as service} from '@ember/service';
export default Component.extend({
session: service(),
tagName: 'li',
classNames: ['gh-list-row', 'gh-posts-list-item'],
authorNames: computed('post.authors.[]', function () {
let authors = this.get('post.authors');
return authors.map(author => author.get('name') || author.get('email')).join(', ');
})
});