Files
threshold-ui/addons/api/mirage/serializers/connection-recording.js
T
Zhihe Li bcf004b8a4 Reformat codebase with trailing commas in functions (#2006)
* style: 💄 Update trailing commas in API

* style: 💄 Update trailing commas in core

* style: 💄 Update trailing commas in rose

* style: 💄 Update trailing commas in admin

* style: 💄 Update trailing commas in desktop
2023-11-22 14:07:41 -05:00

26 lines
728 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;
},
});