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:
1 parent
14623a6386
commit
087e1346d3
4 files changed
+54
-11
No files matched your search
@@ -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;
|
||||
}
|
||||
Reference in new issue
Block a user