import Controller from '@ember/controller'; import { inject as service } from '@ember/service'; export default Controller.extend({ notificationData : service(), router: service(), queryParams: ['page', 'perPage', 'sort', 'filter'], page: 1, perPage: 10, filter: null, init() { this._super(...arguments); this.table = { mode: "list", model: "notification", columns: [ { name: 'Title', key: 'title', uri: "notification.detail", editUri: "notification.edit" }, { name: 'content', key: 'content', }, { name: 'Is Read', key: 'isRead', }, ] }; }, actions : { deleteRow(data) { let result = confirm('Are you sure want to delete this data?'); if (result) { if (data != null) { this.notificationData.delete(data).then(() => { this.router.transitionTo('notification.index'); }); } } }, }, });