Files
threshold-ui/addons/api/addon/models/connection-recording.js
T
Cameron Perera 1717968e59 Icu 9020 move connection channel sorting to model (#217)
* test: 💍 add tests for sorted connection and channels

* feat: 🎸 Add sorted property for connections and channels

✅ Closes: ICU-9020
2023-04-24 12:10:17 -05:00

13 lines
561 B
JavaScript

import GeneratedConnectionRecordingModel from '../generated/models/connection-recording';
import { belongsTo, hasMany } from '@ember-data/model';
import { sort } from '@ember/object/computed';
export default class ConnectionRecordingModel extends GeneratedConnectionRecordingModel {
@belongsTo('session-recording', { async: false }) session_recording;
@hasMany('channel-recording', { async: false }) channel_recordings;
startTimeSortingDesc = ['start_time:desc'];
@sort('channel_recordings', 'startTimeSortingDesc')
sortedChannelsByStartTimeDesc;
}