Fix a bug where the NodeListStub API response would override existing HostVolumes in the store

This commit is contained in:
Michael Lange 2020-02-12 22:13:16 -08:00
parent 895d74c503
commit 9186f75c6a
1 changed files with 4 additions and 2 deletions

View File

@ -17,8 +17,10 @@ export default ApplicationSerializer.extend({
return assign({}, drivers[key], { Name: key });
});
const hostVolumes = hash.HostVolumes || {};
hash.HostVolumes = Object.keys(hostVolumes).map(key => hostVolumes[key]);
if (hash.HostVolumes) {
const hostVolumes = hash.HostVolumes;
hash.HostVolumes = Object.keys(hostVolumes).map(key => hostVolumes[key]);
}
return this._super(modelClass, hash);
},