open-vault/ui/app/serializers/capabilities.js
Jordan Reimer 52fe56ec87
Eslint prefer-const (#17864)
* adds prefer-const to eslint config and runs fixer

* reverts unintended change
2022-11-09 15:15:31 -08:00

22 lines
544 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;
}
const response = {
...payload.data,
path: payload.path,
};
return this._super(store, primaryModelClass, response, id, requestType);
},
modelNameFromPayloadKey() {
return 'capabilities';
},
});