open-vault/ui/app/serializers/transform/alphabet.js
Chelsea Shaw 2289c9ef1d
CRUD for transform alphabets (#9989)
includes tests for templates and alphabets
2020-09-21 15:36:07 -05:00

23 lines
560 B
JavaScript

import ApplicationSerializer from '../application';
export default ApplicationSerializer.extend({
normalizeResponse(store, primaryModelClass, payload, id, requestType) {
payload.data.name = payload.id;
return this._super(store, primaryModelClass, payload, id, requestType);
},
extractLazyPaginatedData(payload) {
let ret;
ret = payload.data.keys.map(key => {
let model = {
id: key,
};
if (payload.backend) {
model.backend = payload.backend;
}
return model;
});
return ret;
},
});