mirror of
https://github.com/status-im/consul.git
synced 2025-01-10 05:45:46 +00:00
18 lines
402 B
JavaScript
18 lines
402 B
JavaScript
|
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;
|
||
|
},
|
||
|
});
|