refactor: 💡 simplify host catalog modeling and normalization
This commit is contained in:
3 files changed
-21
No files matched your search
@@ -39,11 +39,6 @@ export default class GeneratedHostCatalogModel extends BaseModel {
|
||||
})
|
||||
disabled;
|
||||
|
||||
@attr({
|
||||
description: 'Attributes specific to the catalog type',
|
||||
})
|
||||
attributes;
|
||||
|
||||
@attr('number', {
|
||||
description: 'Current version number of this resource.',
|
||||
})
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import ApplicationSerializer from './application';
|
||||
import { copy } from 'ember-copy';
|
||||
|
||||
const fieldsByType = {
|
||||
aws: [
|
||||
@@ -57,11 +56,4 @@ export default class HostCatalogSerializer extends ApplicationSerializer {
|
||||
delete serialized.secrets;
|
||||
return serialized;
|
||||
}
|
||||
|
||||
normalize(typeClass, hash, ...rest) {
|
||||
let normalizedHash = copy(hash, true);
|
||||
const normalized = super.normalize(typeClass, normalizedHash, ...rest);
|
||||
delete normalized.data.attributes.attributes;
|
||||
return normalized;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user