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