30 lines
696 B
JavaScript
30 lines
696 B
JavaScript
/**
|
|
* Copyright (c) HashiCorp, Inc.
|
|
* SPDX-License-Identifier: BUSL-1.1
|
|
*/
|
|
|
|
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;
|
|
},
|
|
});
|