]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/middlewares/validators/sort.ts
Cleanup useless express validator messages
[github/Chocobozzz/PeerTube.git] / server / middlewares / validators / sort.ts
index c9978e3b4542b71e1a027240068216c1cc5f333a..269f1be531060f4fa278315bb2b7169bf72817c8 100644 (file)
@@ -10,7 +10,9 @@ function checkSortFactory (columns: string[], tags: string[] = []) {
 
 function checkSort (sortableColumns: string[], tags: string[] = []) {
   return [
-    query('sort').optional().isIn(sortableColumns).withMessage('Should have correct sortable column'),
+    query('sort')
+      .optional()
+      .isIn(sortableColumns),
 
     (req: express.Request, res: express.Response, next: express.NextFunction) => {
       logger.debug('Checking sort parameters', { parameters: req.query, tags })
@@ -52,6 +54,7 @@ const videoPlaylistsSortValidator = checkSortFactory(SORTABLE_COLUMNS.VIDEO_PLAY
 const pluginsSortValidator = checkSortFactory(SORTABLE_COLUMNS.PLUGINS)
 const availablePluginsSortValidator = checkSortFactory(SORTABLE_COLUMNS.AVAILABLE_PLUGINS)
 const videoRedundanciesSortValidator = checkSortFactory(SORTABLE_COLUMNS.VIDEO_REDUNDANCIES)
+const videoChannelSyncsSortValidator = checkSortFactory(SORTABLE_COLUMNS.VIDEO_CHANNEL_SYNCS)
 
 const accountsFollowersSortValidator = checkSortFactory(SORTABLE_COLUMNS.ACCOUNT_FOLLOWERS)
 const videoChannelsFollowersSortValidator = checkSortFactory(SORTABLE_COLUMNS.CHANNEL_FOLLOWERS)
@@ -84,5 +87,6 @@ export {
   videoPlaylistsSearchSortValidator,
   accountsFollowersSortValidator,
   videoChannelsFollowersSortValidator,
+  videoChannelSyncsSortValidator,
   pluginsSortValidator
 }