mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-03 23:00:14 -05:00
3d6856614f
no issue - add ember-suave dependency - upgrade grunt-jscs dependency - add a new .jscsrc for the client's tests directory that extends from client's base .jscsrc - separate client tests in Gruntfile jscs task so they pick up the test's .jscsrc - standardize es6 usage across client
38 lines
1.1 KiB
JavaScript
38 lines
1.1 KiB
JavaScript
import Ember from 'ember';
|
|
import {request as ajax} from 'ic-ajax';
|
|
|
|
const {Controller, inject} = Ember;
|
|
|
|
export default Controller.extend({
|
|
ghostPaths: inject.service('ghost-paths'),
|
|
notifications: inject.service(),
|
|
|
|
confirm: {
|
|
accept: {
|
|
text: 'Delete',
|
|
buttonClass: 'btn btn-red'
|
|
},
|
|
reject: {
|
|
text: 'Cancel',
|
|
buttonClass: 'btn btn-default btn-minor'
|
|
}
|
|
},
|
|
|
|
actions: {
|
|
confirmAccept() {
|
|
ajax(this.get('ghostPaths.url').api('db'), {
|
|
type: 'DELETE'
|
|
}).then(() => {
|
|
this.get('notifications').showAlert('All content deleted from database.', {type: 'success', key: 'all-content.delete.success'});
|
|
this.store.unloadAll('post');
|
|
this.store.unloadAll('tag');
|
|
}).catch((response) => {
|
|
this.get('notifications').showAPIError(response, {key: 'all-content.delete'});
|
|
});
|
|
},
|
|
|
|
confirmReject() {
|
|
return false;
|
|
}
|
|
}
|
|
});
|