Ghost/ghost/admin/app/controllers/mentions.js
2023-01-25 12:47:48 +00:00

22 lines
558 B
JavaScript

import Controller from '@ember/controller';
import {A} from '@ember/array';
import {inject as service} from '@ember/service';
import {task} from 'ember-concurrency';
import {tracked} from '@glimmer/tracking';
export default class MentionsController extends Controller {
@service store;
@tracked mentionsList = A([]);
constructor() {
super(...arguments);
}
@task
*loadMentionsTask() {
const mentions = yield this.store.query('mention', {order: 'created_at desc'});
this.mentionsList = mentions;
}
}