add sorting by wordsCount

This commit is contained in:
Hongbo Wu 2023-05-03 08:36:33 +08:00
parent 3041cd0517
commit a4d385bc83

View file

@ -68,6 +68,7 @@ export enum SortBy {
PUBLISHED = 'publishedAt',
READ = 'readAt',
LISTENED = 'listenedAt',
WORDS_COUNT = 'wordsCount',
}
export enum SortOrder {
@ -202,6 +203,11 @@ const parseSortParams = (str?: string): SortParams | undefined => {
by: SortBy.READ,
order: sortOrder,
}
case 'WORDSCOUNT':
return {
by: SortBy.WORDS_COUNT,
order: sortOrder,
}
}
}