Allow to sort by likes
This commit is contained in:
parent
d38b828106
commit
86e8393986
|
@ -1,3 +1,6 @@
|
||||||
export type SortField = 'name' | '-name'
|
export type SortField = 'name' | '-name'
|
||||||
| 'duration' | '-duration'
|
| 'duration' | '-duration'
|
||||||
| 'createdAt' | '-createdAt';
|
| 'createdAt' | '-createdAt'
|
||||||
|
| 'views' | '-views'
|
||||||
|
| 'likes' | '-likes';
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,6 @@ import { SearchService } from '../../shared';
|
||||||
styleUrls: [ './video-list.component.scss' ],
|
styleUrls: [ './video-list.component.scss' ],
|
||||||
templateUrl: './video-list.component.html'
|
templateUrl: './video-list.component.html'
|
||||||
})
|
})
|
||||||
|
|
||||||
export class VideoListComponent implements OnInit, OnDestroy {
|
export class VideoListComponent implements OnInit, OnDestroy {
|
||||||
loading: BehaviorSubject<boolean> = new BehaviorSubject(false);
|
loading: BehaviorSubject<boolean> = new BehaviorSubject(false);
|
||||||
pagination: RestPagination = {
|
pagination: RestPagination = {
|
||||||
|
|
|
@ -12,7 +12,7 @@ export class VideoSortComponent {
|
||||||
|
|
||||||
@Input() currentSort: SortField;
|
@Input() currentSort: SortField;
|
||||||
|
|
||||||
sortChoices = {
|
sortChoices: { [ id: SortField ]: string } = {
|
||||||
'name': 'Name - Asc',
|
'name': 'Name - Asc',
|
||||||
'-name': 'Name - Desc',
|
'-name': 'Name - Desc',
|
||||||
'duration': 'Duration - Asc',
|
'duration': 'Duration - Asc',
|
||||||
|
@ -20,7 +20,9 @@ export class VideoSortComponent {
|
||||||
'createdAt': 'Created Date - Asc',
|
'createdAt': 'Created Date - Asc',
|
||||||
'-createdAt': 'Created Date - Desc',
|
'-createdAt': 'Created Date - Desc',
|
||||||
'views': 'Views - Asc',
|
'views': 'Views - Asc',
|
||||||
'-views': 'Views - Desc'
|
'-views': 'Views - Desc',
|
||||||
|
'likes': 'Likes - Asc',
|
||||||
|
'-likes': 'Likes - Desc'
|
||||||
};
|
};
|
||||||
|
|
||||||
get choiceKeys() {
|
get choiceKeys() {
|
||||||
|
|
|
@ -24,7 +24,7 @@ const SEARCHABLE_COLUMNS = {
|
||||||
const SORTABLE_COLUMNS = {
|
const SORTABLE_COLUMNS = {
|
||||||
USERS: [ 'id', 'username', 'createdAt' ],
|
USERS: [ 'id', 'username', 'createdAt' ],
|
||||||
VIDEO_ABUSES: [ 'id', 'createdAt' ],
|
VIDEO_ABUSES: [ 'id', 'createdAt' ],
|
||||||
VIDEOS: [ 'name', 'duration', 'createdAt', 'views' ]
|
VIDEOS: [ 'name', 'duration', 'createdAt', 'views', 'likes' ]
|
||||||
}
|
}
|
||||||
|
|
||||||
const OAUTH_LIFETIME = {
|
const OAUTH_LIFETIME = {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user