]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/helpers/custom-validators/search.ts
External auth can update user on login
[github/Chocobozzz/PeerTube.git] / server / helpers / custom-validators / search.ts
index 429fcafcf9525f94e392f88baeb687a559d88a36..6dba5d14e2461877e95afd3cb28b15e56b65cb52 100644 (file)
@@ -11,7 +11,7 @@ function isStringArray (value: any) {
   return isArray(value) && value.every(v => typeof v === 'string')
 }
 
-function isNSFWQueryValid (value: any) {
+function isBooleanBothQueryValid (value: any) {
   return value === 'true' || value === 'false' || value === 'both'
 }
 
@@ -20,7 +20,7 @@ function isSearchTargetValid (value: SearchTargetType) {
 
   const searchIndexConfig = CONFIG.SEARCH.SEARCH_INDEX
 
-  if (value === 'local' && (!searchIndexConfig.ENABLED || !searchIndexConfig.DISABLE_LOCAL_SEARCH)) return true
+  if (value === 'local') return true
 
   if (value === 'search-index' && searchIndexConfig.ENABLED) return true
 
@@ -32,6 +32,6 @@ function isSearchTargetValid (value: SearchTargetType) {
 export {
   isNumberArray,
   isStringArray,
-  isNSFWQueryValid,
+  isBooleanBothQueryValid,
   isSearchTargetValid
 }