129494d98a
* 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
22 lines
542 B
JavaScript
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';
|
|
},
|
|
});
|