sepia-search-motore-di-rice.../server/middlewares/validators/sort.ts

19 lines
835 B
TypeScript
Raw Normal View History

2020-02-14 16:14:45 +01:00
import { SORTABLE_COLUMNS } from '../../initializers/constants'
import { checkSort, createSortableColumns } from './utils'
const SORTABLE_VIDEOS_SEARCH_COLUMNS = createSortableColumns(SORTABLE_COLUMNS.VIDEOS_SEARCH)
2020-02-19 15:39:35 +01:00
const SORTABLE_CHANNELS_SEARCH_COLUMNS = createSortableColumns(SORTABLE_COLUMNS.CHANNELS_SEARCH)
2021-06-24 15:18:54 +02:00
const SORTABLE_PLAYLISTS_SEARCH_COLUMNS = createSortableColumns(SORTABLE_COLUMNS.PLAYLISTS_SEARCH)
2020-02-14 16:14:45 +01:00
const videosSearchSortValidator = checkSort(SORTABLE_VIDEOS_SEARCH_COLUMNS)
const channelsSearchSortValidator = checkSort(SORTABLE_CHANNELS_SEARCH_COLUMNS)
2021-06-24 15:18:54 +02:00
const playlistsSearchSortValidator = checkSort(SORTABLE_PLAYLISTS_SEARCH_COLUMNS)
2020-02-14 16:14:45 +01:00
2020-02-13 11:49:03 +01:00
// ---------------------------------------------------------------------------
export {
2020-02-19 15:39:35 +01:00
videosSearchSortValidator,
2021-06-24 15:18:54 +02:00
channelsSearchSortValidator,
playlistsSearchSortValidator
2020-02-13 11:49:03 +01:00
}