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

36 lines
938 B
JavaScript
Raw Normal View History

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