mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-07 11:30:55 +03:00
parent
e693d5ed2d
commit
542400d6f1
@ -31,7 +31,8 @@ export default Ember.Controller.extend({
|
|||||||
onUpload: function (file) {
|
onUpload: function (file) {
|
||||||
var self = this,
|
var self = this,
|
||||||
formData = new FormData(),
|
formData = new FormData(),
|
||||||
notifications = this.get('notifications');
|
notifications = this.get('notifications'),
|
||||||
|
currentUserId = this.get('session.user.id');
|
||||||
|
|
||||||
this.set('uploadButtonText', 'Importing');
|
this.set('uploadButtonText', 'Importing');
|
||||||
this.set('importErrors', '');
|
this.set('importErrors', '');
|
||||||
@ -48,12 +49,9 @@ export default Ember.Controller.extend({
|
|||||||
processData: false
|
processData: false
|
||||||
}).then(function () {
|
}).then(function () {
|
||||||
// Clear the store, so that all the new data gets fetched correctly.
|
// Clear the store, so that all the new data gets fetched correctly.
|
||||||
self.store.unloadAll('post');
|
self.store.unloadAll();
|
||||||
self.store.unloadAll('tag');
|
// Reload currentUser and set session
|
||||||
self.store.unloadAll('user');
|
self.set('session.user', self.store.find('user', currentUserId));
|
||||||
self.store.unloadAll('role');
|
|
||||||
self.store.unloadAll('setting');
|
|
||||||
self.store.unloadAll('notification');
|
|
||||||
notifications.showSuccess('Import successful.');
|
notifications.showSuccess('Import successful.');
|
||||||
}).catch(function (response) {
|
}).catch(function (response) {
|
||||||
if (response && response.jqXHR && response.jqXHR.responseJSON && response.jqXHR.responseJSON.errors) {
|
if (response && response.jqXHR && response.jqXHR.responseJSON && response.jqXHR.responseJSON.errors) {
|
||||||
|
Loading…
Reference in New Issue
Block a user