Ghost/core/client/controllers/modals/delete-all.js

33 lines
812 B
JavaScript
Raw Normal View History

2014-03-31 08:07:05 +04:00
var DeleteAllController = Ember.Controller.extend({
actions: {
confirmAccept: function () {
var self = this;
2014-03-31 08:07:05 +04:00
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);
});
},
2014-03-31 08:07:05 +04:00
confirmReject: function () {
return false;
}
},
2014-03-31 08:07:05 +04:00
confirm: {
accept: {
text: 'Delete',
buttonClass: 'button-delete'
2014-03-31 08:07:05 +04:00
},
reject: {
text: 'Cancel',
buttonClass: 'button'
2014-03-31 08:07:05 +04:00
}
}
});
export default DeleteAllController;