* chore: 🤖 Rename recording to session-recording * chore: 🤖 Update names for connection models * chore: 🤖 Update channel models to new name * chore: 🤖 Update remaining models after merge conflict
26 lines
727 B
JavaScript
26 lines
727 B
JavaScript
/**
|
|
* Copyright (c) HashiCorp, Inc.
|
|
* SPDX-License-Identifier: MPL-2.0
|
|
*/
|
|
|
|
import ApplicationSerializer from './application';
|
|
import ChannelSerializer from './channel-recording';
|
|
|
|
export default ApplicationSerializer.extend({
|
|
modelName: 'connection-recording',
|
|
_hashForModel(model) {
|
|
const json = ApplicationSerializer.prototype._hashForModel.apply(
|
|
this,
|
|
arguments
|
|
);
|
|
const { channelRecordings } = this.schema;
|
|
if (model.channelRecordingIds) {
|
|
json.channel_recordings = model.channelRecordingIds.map((id) => {
|
|
const channel = channelRecordings.find(id);
|
|
return ChannelSerializer.prototype._hashForModel.apply(this, [channel]);
|
|
});
|
|
}
|
|
return json;
|
|
},
|
|
});
|