2022-03-24 18:21:46 +03:00
|
|
|
import Component from '@glimmer/component';
|
2022-03-24 20:14:51 +03:00
|
|
|
import {action} from '@ember/object';
|
2022-03-24 18:21:46 +03:00
|
|
|
import {inject as service} from '@ember/service';
|
2022-03-24 20:14:51 +03:00
|
|
|
import {tracked} from '@glimmer/tracking';
|
2022-03-24 18:21:46 +03:00
|
|
|
|
|
|
|
export default class RecentPosts extends Component {
|
2022-03-24 20:14:51 +03:00
|
|
|
@service store;
|
|
|
|
|
|
|
|
@tracked posts = [];
|
|
|
|
|
|
|
|
@action
|
|
|
|
async loadPosts() {
|
|
|
|
this.posts = await this.store.query('post', {limit: 5, filter: 'status:published', order: 'published_at desc'});
|
|
|
|
}
|
2022-03-24 18:21:46 +03:00
|
|
|
}
|