mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-13 14:39:52 +03:00
f5e05c8d9f
Closes #2847
36 lines
938 B
JavaScript
36 lines
938 B
JavaScript
var DeleteAllController = Ember.Controller.extend({
|
|
actions: {
|
|
confirmAccept: function () {
|
|
var self = this;
|
|
|
|
ic.ajax.request(this.get('ghostPaths').apiUrl('db'), {
|
|
type: 'DELETE',
|
|
headers: {
|
|
'X-CSRF-Token': $('meta[name="csrf-param"]').attr('content')
|
|
}
|
|
}).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: 'button-delete'
|
|
},
|
|
reject: {
|
|
text: 'Cancel',
|
|
buttonClass: 'button'
|
|
}
|
|
}
|
|
});
|
|
|
|
export default DeleteAllController;
|