mirror of https://github.com/status-im/consul.git
22 lines
478 B
JavaScript
22 lines
478 B
JavaScript
import Serializer from './application';
|
|
|
|
export default Serializer.extend({
|
|
primaryKey: 'Name',
|
|
respondForQuery: function(respond, query) {
|
|
return respond(function(headers, body) {
|
|
return body;
|
|
});
|
|
},
|
|
normalizePayload: function(payload, id, requestType) {
|
|
switch (requestType) {
|
|
case 'query':
|
|
return payload.map(item => {
|
|
return {
|
|
[this.primaryKey]: item,
|
|
};
|
|
});
|
|
}
|
|
return payload;
|
|
},
|
|
});
|