feat: 🎸 Refactor serializer and model for managed-group

Refactor serializer and model with suggestions from previous PR for
managed-group.
This commit is contained in:
Carlos Alcaide Corvo committed 2021-11-05 08:55:37 -07:00
1 parent 14623a6386
commit 087e1346d3
4 files changed
+54 -11

No files matched your search

+12 -3
View File
@@ -1,12 +1,21 @@
import GeneratedManagedGroupModel from '../generated/models/managed-group';
import { attr } from '@ember-data/model';
import { fragment } from 'ember-data-model-fragments/attributes';
import { A } from '@ember/array';
export default class ManagedGroupModel extends GeneratedManagedGroupModel {
// =error attributes
@attr('string', { readOnly: true }) filter;
// =attributes
/**
* Members is read-only under normal circumstances. But members can
* be persisted via calls to `addMembers()` or `removeMembers()`.
*/
@attr({
readOnly: true,
defaultValue: () => A(),
emptyArrayIfMissing: true,
})
member_ids;
@fragment('fragment-managed-group-attributes', { defaultValue: {} })
attributes;
}