2014-03-31 08:07:05 +04:00
|
|
|
var DeleteAllController = Ember.Controller.extend({
|
2014-06-04 01:10:54 +04:00
|
|
|
actions: {
|
|
|
|
confirmAccept: function () {
|
2014-06-23 18:24:37 +04:00
|
|
|
var self = this;
|
2014-03-31 08:07:05 +04:00
|
|
|
|
2014-07-13 08:01:26 +04:00
|
|
|
ic.ajax.request(this.get('ghostPaths.url').api('db'), {
|
2014-07-01 13:39:01 +04:00
|
|
|
type: 'DELETE'
|
2014-06-23 18:24:37 +04:00
|
|
|
}).then(function () {
|
|
|
|
self.notifications.showSuccess('All content deleted from database.');
|
|
|
|
}).catch(function (response) {
|
|
|
|
self.notifications.showErrors(response);
|
|
|
|
});
|
2014-06-04 01:10:54 +04:00
|
|
|
},
|
2014-03-31 08:07:05 +04:00
|
|
|
|
2014-06-04 01:10:54 +04:00
|
|
|
confirmReject: function () {
|
2014-06-23 18:24:37 +04:00
|
|
|
return false;
|
2014-06-04 01:10:54 +04:00
|
|
|
}
|
|
|
|
},
|
2014-03-31 08:07:05 +04:00
|
|
|
|
2014-06-04 01:10:54 +04:00
|
|
|
confirm: {
|
|
|
|
accept: {
|
2014-06-02 00:53:16 +04:00
|
|
|
text: 'Delete',
|
|
|
|
buttonClass: 'button-delete'
|
2014-03-31 08:07:05 +04:00
|
|
|
},
|
|
|
|
reject: {
|
2014-06-02 00:53:16 +04:00
|
|
|
text: 'Cancel',
|
|
|
|
buttonClass: 'button'
|
2014-03-31 08:07:05 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
export default DeleteAllController;
|