open-consul/ui/packages/consul-ui/app/serializers/peer.js

22 lines
548 B
JavaScript

import JSONAPISerializer from '@ember-data/serializer/json-api';
export default class PeerSerializer extends JSONAPISerializer {
keyForAttribute(key) {
return key.capitalize();
}
normalizeFindAllResponse(store, primaryModelClass, payload, id, requestType) {
const data = payload.map(peering => {
return {
type: 'peer',
id: peering.ID,
attributes: {
...peering,
},
};
});
return super.normalizeFindAllResponse(store, primaryModelClass, { data }, id, requestType);
}
}