mirror of
https://github.com/fleetbase/fleetbase.git
synced 2026-01-08 07:16:49 +00:00
19 lines
532 B
JavaScript
19 lines
532 B
JavaScript
import ApplicationSerializer from '@fleetbase/ember-core/serializers/application';
|
|
import { EmbeddedRecordsMixin } from '@ember-data/serializer/rest';
|
|
|
|
export default class DashboardSerializer extends ApplicationSerializer.extend(EmbeddedRecordsMixin) {
|
|
attrs = {
|
|
widgets: { embedded: 'always' },
|
|
};
|
|
|
|
serializeHasMany(snapshot, json, relationship) {
|
|
let key = relationship.key;
|
|
|
|
if (key === 'widgets') {
|
|
return;
|
|
}
|
|
|
|
return super.serializeHasMany(...arguments);
|
|
}
|
|
}
|