0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-27 22:49:56 -05:00
ghost/core/client/controllers/modals/delete-all.js

33 lines
811 B
JavaScript
Raw Normal View History

2014-03-31 00:07:05 -04:00
var DeleteAllController = Ember.Controller.extend({
actions: {
confirmAccept: function () {
var self = this;
2014-03-31 00:07:05 -04:00
ic.ajax.request(this.get('ghostPaths').apiUrl('db'), {
type: 'DELETE'
}).then(function () {
self.notifications.showSuccess('All content deleted from database.');
}).catch(function (response) {
self.notifications.showErrors(response);
});
},
2014-03-31 00:07:05 -04:00
confirmReject: function () {
return false;
}
},
2014-03-31 00:07:05 -04:00
confirm: {
accept: {
text: 'Delete',
buttonClass: 'button-delete'
2014-03-31 00:07:05 -04:00
},
reject: {
text: 'Cancel',
buttonClass: 'button'
2014-03-31 00:07:05 -04:00
}
}
});
export default DeleteAllController;