0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-24 23:48:13 -05:00

Reset the store after import

no issue

- without this, the content screen doesn't update properly after an import
This commit is contained in:
Hannah Wolfe 2015-01-08 13:42:45 +00:00
parent 5f016f7826
commit d81bb926e0

View file

@ -53,6 +53,13 @@ var LabsController = Ember.Controller.extend(Ember.Evented, {
contentType: false, contentType: false,
processData: false processData: false
}).then(function () { }).then(function () {
// Clear the store, so that all the new data gets fetched correctly.
self.store.unloadAll('post');
self.store.unloadAll('tag');
self.store.unloadAll('user');
self.store.unloadAll('role');
self.store.unloadAll('setting');
self.store.unloadAll('notification');
self.notifications.showSuccess('Import successful.'); self.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) {