* [COMPLIANCE] Add Copyright and License Headers * chore: 🤖 update Copyright headers to satisfy our lint rules --------- Co-authored-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com> Co-authored-by: Cameron Perera <cameron.perera@hashicorp.com>
30 lines
693 B
JavaScript
30 lines
693 B
JavaScript
/**
|
|
* Copyright (c) HashiCorp, Inc.
|
|
* SPDX-License-Identifier: MPL-2.0
|
|
*/
|
|
|
|
import ApplicationSerializer from './application';
|
|
import { underscore } from '@ember/string';
|
|
|
|
export default ApplicationSerializer.extend({
|
|
modelName: 'session',
|
|
|
|
keyForRelationshipId(relationshipName) {
|
|
return `${this._container.inflector.singularize(
|
|
underscore(relationshipName)
|
|
)}_id`;
|
|
},
|
|
|
|
_hashForModel(model) {
|
|
const json = ApplicationSerializer.prototype._hashForModel.apply(
|
|
this,
|
|
arguments
|
|
);
|
|
json.user_id = model.userId;
|
|
json.target_id = model.targetId;
|
|
json.host_set_id = model.hostSetId;
|
|
json.host_id = model.hostId;
|
|
return json;
|
|
},
|
|
});
|