fix: 🐛 handle missing host_ids array in host sets

This commit is contained in:
Randall Morey committed 2020-09-12 11:20:38 -04:00
1 parent 7d5bef4440
commit 048e202343
3 files changed
+39 -2

No files matched your search

+3 -1
View File
@@ -12,8 +12,10 @@ export default ApplicationSerializer.extend({
_hashForModel(model) {
const json = ApplicationSerializer.prototype._hashForModel.apply(this, arguments);
json.host_ids = model.hostIds;
json.host_catalog_id = model.hostCatalogId;
if (model.hostIds?.length) {
json.host_ids = model.hostIds;
}
return json;
}