mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-12 16:14:25 +03:00
38 lines
1.2 KiB
JavaScript
38 lines
1.2 KiB
JavaScript
|
/*global alert, console */
|
||
|
|
||
|
var Debug = Ember.Controller.extend(Ember.Evented, {
|
||
|
uploadButtonText: 'Import',
|
||
|
actions: {
|
||
|
importData: function (file) {
|
||
|
var self = this;
|
||
|
this.set('uploadButtonText', 'Importing');
|
||
|
this.get('model').importFrom(file)
|
||
|
.then(function (response) {
|
||
|
console.log(response);
|
||
|
alert('@TODO: success');
|
||
|
})
|
||
|
.catch(function (response) {
|
||
|
console.log(response);
|
||
|
alert('@TODO: error');
|
||
|
})
|
||
|
.finally(function () {
|
||
|
self.set('uploadButtonText', 'Import');
|
||
|
self.trigger('reset');
|
||
|
});
|
||
|
},
|
||
|
sendTestEmail: function () {
|
||
|
this.get('model').sendTestEmail()
|
||
|
.then(function (response) {
|
||
|
console.log(response);
|
||
|
alert('@TODO: success');
|
||
|
})
|
||
|
.catch(function (response) {
|
||
|
console.log(response);
|
||
|
alert('@TODO: error');
|
||
|
});
|
||
|
}
|
||
|
}
|
||
|
});
|
||
|
|
||
|
export default Debug;
|