27bb03bbc0
* adding copyright header * fix fmt and a test
27 lines
622 B
JavaScript
27 lines
622 B
JavaScript
/**
|
|
* Copyright (c) HashiCorp, Inc.
|
|
* SPDX-License-Identifier: MPL-2.0
|
|
*/
|
|
|
|
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';
|
|
},
|
|
});
|