Ghost/ghost/admin/controllers/modals/delete-all.js
2014-08-17 14:57:07 +03:00

33 lines
829 B
JavaScript

var DeleteAllController = Ember.Controller.extend({
actions: {
confirmAccept: function () {
var self = this;
ic.ajax.request(this.get('ghostPaths.url').api('db'), {
type: 'DELETE'
}).then(function () {
self.notifications.showSuccess('All content deleted from database.');
}).catch(function (response) {
self.notifications.showErrors(response);
});
},
confirmReject: function () {
return false;
}
},
confirm: {
accept: {
text: 'Delete',
buttonClass: 'btn btn-red'
},
reject: {
text: 'Cancel',
buttonClass: 'btn btn-default btn-minor'
}
}
});
export default DeleteAllController;