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 0733c1e86e
commit fd87646973

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);
},