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