open-vault/ui/app/serializers/capabilities.js
Matthew Irish 129494d98a
UI unauthed auth methods fix (#5113)
* lowercase auth method type so that hardcoded and unauthed methods both use the same key

* don't rely on top level data for capabilities serializer
2018-08-16 08:16:24 -05:00

22 lines
542 B
JavaScript

import ApplicationSerializer from './application';
export default ApplicationSerializer.extend({
primaryKey: 'path',
normalizeResponse(store, primaryModelClass, payload, id, requestType) {
// queryRecord will already have set this, and we won't have an id here
if (id) {
payload.path = id;
}
let response = {
...payload.data,
path: payload.path,
};
return this._super(store, primaryModelClass, response, id, requestType);
},
modelNameFromPayloadKey() {
return 'capabilities';
},
});