Files
threshold-ui/addons/api/addon/models/channel-recording.js
T
Zhihe Li d08ce29e5a Chore/update model names (#125)
* 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
2023-03-16 13:49:04 -04:00

28 lines
747 B
JavaScript

import GeneratedChannelRecordingModel from '../generated/models/channel-recording';
import { belongsTo } from '@ember-data/model';
export const TYPE_CHANNEL_RECORDING_SESSION = 'session';
export const TYPES_CHANNEL_RECORDING = Object.freeze([
TYPE_CHANNEL_RECORDING_SESSION,
]);
export default class ChannelRecordingModel extends GeneratedChannelRecordingModel {
@belongsTo('connection-recording') connection_recording;
/**
* True if the channel type is `session`.
* @type {boolean}
*/
get isSession() {
return this.type === TYPE_CHANNEL_RECORDING_SESSION;
}
/**
* True if the channel is an unknown type.
* @type {boolean}
*/
get isUnknown() {
return !TYPES_CHANNEL_RECORDING.includes(this.type);
}
}