open-vault/ui/app/serializers/capabilities.js

22 lines
544 B
JavaScript
Raw Normal View History

import ApplicationSerializer from './application';
2018-04-03 14:16:57 +00:00
export default ApplicationSerializer.extend({
2018-04-03 14:16:57 +00:00
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;
}
const response = {
...payload.data,
path: payload.path,
2018-04-03 14:16:57 +00:00
};
return this._super(store, primaryModelClass, response, id, requestType);
},
modelNameFromPayloadKey() {
return 'capabilities';
},
});