You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
consul/ui-v2/app/serializers/dc.js

18 lines
402 B

import Serializer from './application';
import { get } from '@ember/object';
export default Serializer.extend({
primaryKey: 'Name',
normalizePayload: function(payload, id, requestType) {
switch (requestType) {
case 'findAll':
return payload.map(item => {
return {
[get(this, 'primaryKey')]: item,
};
});
}
return payload;
},
});