Add blacklist reason field
[oweals/peertube.git] / server / helpers / custom-validators / search.ts
index 2fde391602014aa33ee46726e7dddfa7c7c041fc..15b389a58e5969f36070c1cd59e859ec737c8d9f 100644 (file)
@@ -11,9 +11,14 @@ function isStringArray (value: any) {
   return isArray(value) && value.every(v => typeof v === 'string')
 }
 
+function isNSFWQueryValid (value: any) {
+  return value === 'true' || value === 'false' || value === 'both'
+}
+
 // ---------------------------------------------------------------------------
 
 export {
   isNumberArray,
-  isStringArray
+  isStringArray,
+  isNSFWQueryValid
 }