]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - server/middlewares/validators/sort.ts
Fix problem with SMTP in default docker-compose setup
[github/Chocobozzz/PeerTube.git] / server / middlewares / validators / sort.ts
CommitLineData
65fcc311 1import { SORTABLE_COLUMNS } from '../../initializers'
5c328e66 2import { checkSort, createSortableColumns } from './utils'
a877d5ac 3
9c2c18f3 4// Initialize constants here for better performances
65fcc311 5const SORTABLE_USERS_COLUMNS = createSortableColumns(SORTABLE_COLUMNS.USERS)
265ba139 6const SORTABLE_ACCOUNTS_COLUMNS = createSortableColumns(SORTABLE_COLUMNS.ACCOUNTS)
5cd80545 7const SORTABLE_JOBS_COLUMNS = createSortableColumns(SORTABLE_COLUMNS.JOBS)
65fcc311
C
8const SORTABLE_VIDEO_ABUSES_COLUMNS = createSortableColumns(SORTABLE_COLUMNS.VIDEO_ABUSES)
9const SORTABLE_VIDEOS_COLUMNS = createSortableColumns(SORTABLE_COLUMNS.VIDEOS)
57c36b27 10const SORTABLE_VIDEOS_SEARCH_COLUMNS = createSortableColumns(SORTABLE_COLUMNS.VIDEOS_SEARCH)
f37dc0dd 11const SORTABLE_VIDEO_CHANNELS_SEARCH_COLUMNS = createSortableColumns(SORTABLE_COLUMNS.VIDEO_CHANNELS_SEARCH)
ed31c059 12const SORTABLE_VIDEO_IMPORTS_COLUMNS = createSortableColumns(SORTABLE_COLUMNS.VIDEO_IMPORTS)
bf1f6508 13const SORTABLE_VIDEO_COMMENT_THREADS_COLUMNS = createSortableColumns(SORTABLE_COLUMNS.VIDEO_COMMENT_THREADS)
792dbaf0 14const SORTABLE_BLACKLISTS_COLUMNS = createSortableColumns(SORTABLE_COLUMNS.BLACKLISTS)
72c7248b 15const SORTABLE_VIDEO_CHANNELS_COLUMNS = createSortableColumns(SORTABLE_COLUMNS.VIDEO_CHANNELS)
7a7724e6
C
16const SORTABLE_FOLLOWERS_COLUMNS = createSortableColumns(SORTABLE_COLUMNS.FOLLOWERS)
17const SORTABLE_FOLLOWING_COLUMNS = createSortableColumns(SORTABLE_COLUMNS.FOLLOWING)
06a05d5f 18const SORTABLE_USER_SUBSCRIPTIONS_COLUMNS = createSortableColumns(SORTABLE_COLUMNS.USER_SUBSCRIPTIONS)
7ad9b984
C
19const SORTABLE_ACCOUNTS_BLOCKLIST_COLUMNS = createSortableColumns(SORTABLE_COLUMNS.ACCOUNTS_BLOCKLIST)
20const SORTABLE_SERVERS_BLOCKLIST_COLUMNS = createSortableColumns(SORTABLE_COLUMNS.SERVERS_BLOCKLIST)
cef534ed 21const SORTABLE_USER_NOTIFICATIONS_COLUMNS = createSortableColumns(SORTABLE_COLUMNS.USER_NOTIFICATIONS)
5c39adb7 22
b60e5f38 23const usersSortValidator = checkSort(SORTABLE_USERS_COLUMNS)
265ba139 24const accountsSortValidator = checkSort(SORTABLE_ACCOUNTS_COLUMNS)
5cd80545 25const jobsSortValidator = checkSort(SORTABLE_JOBS_COLUMNS)
b60e5f38
C
26const videoAbusesSortValidator = checkSort(SORTABLE_VIDEO_ABUSES_COLUMNS)
27const videosSortValidator = checkSort(SORTABLE_VIDEOS_COLUMNS)
ed31c059 28const videoImportsSortValidator = checkSort(SORTABLE_VIDEO_IMPORTS_COLUMNS)
57c36b27 29const videosSearchSortValidator = checkSort(SORTABLE_VIDEOS_SEARCH_COLUMNS)
f37dc0dd 30const videoChannelsSearchSortValidator = checkSort(SORTABLE_VIDEO_CHANNELS_SEARCH_COLUMNS)
bf1f6508 31const videoCommentThreadsSortValidator = checkSort(SORTABLE_VIDEO_COMMENT_THREADS_COLUMNS)
792dbaf0 32const blacklistSortValidator = checkSort(SORTABLE_BLACKLISTS_COLUMNS)
72c7248b 33const videoChannelsSortValidator = checkSort(SORTABLE_VIDEO_CHANNELS_COLUMNS)
7a7724e6
C
34const followersSortValidator = checkSort(SORTABLE_FOLLOWERS_COLUMNS)
35const followingSortValidator = checkSort(SORTABLE_FOLLOWING_COLUMNS)
06a05d5f 36const userSubscriptionsSortValidator = checkSort(SORTABLE_USER_SUBSCRIPTIONS_COLUMNS)
7ad9b984
C
37const accountsBlocklistSortValidator = checkSort(SORTABLE_ACCOUNTS_BLOCKLIST_COLUMNS)
38const serversBlocklistSortValidator = checkSort(SORTABLE_SERVERS_BLOCKLIST_COLUMNS)
cef534ed 39const userNotificationsSortValidator = checkSort(SORTABLE_USER_NOTIFICATIONS_COLUMNS)
55fa55a9
C
40
41// ---------------------------------------------------------------------------
42
65fcc311
C
43export {
44 usersSortValidator,
45 videoAbusesSortValidator,
72c7248b 46 videoChannelsSortValidator,
ed31c059 47 videoImportsSortValidator,
57c36b27 48 videosSearchSortValidator,
792dbaf0 49 videosSortValidator,
7a7724e6 50 blacklistSortValidator,
265ba139 51 accountsSortValidator,
7a7724e6 52 followersSortValidator,
5cd80545 53 followingSortValidator,
bf1f6508 54 jobsSortValidator,
06a05d5f 55 videoCommentThreadsSortValidator,
f37dc0dd 56 userSubscriptionsSortValidator,
7ad9b984
C
57 videoChannelsSearchSortValidator,
58 accountsBlocklistSortValidator,
cef534ed
C
59 serversBlocklistSortValidator,
60 userNotificationsSortValidator
65fcc311 61}