]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/helpers/express-utils.ts
Add advanced search in client
[github/Chocobozzz/PeerTube.git] / server / helpers / express-utils.ts
index 5bf1e1a5f513dcce46121e884f31c2bdd6fc257d..76440348f32ccc38bcdd8adb625e34695530d1c7 100644 (file)
@@ -5,8 +5,10 @@ import { logger } from './logger'
 import { User } from '../../shared/models/users'
 import { generateRandomString } from './utils'
 
-function buildNSFWFilter (res: express.Response, paramNSFW?: boolean) {
-  if (paramNSFW === true || paramNSFW === false) return paramNSFW
+function buildNSFWFilter (res: express.Response, paramNSFW?: string) {
+  if (paramNSFW === 'true') return true
+  if (paramNSFW === 'false') return false
+  if (paramNSFW === 'both') return undefined
 
   if (res.locals.oauth) {
     const user: User = res.locals.oauth.token.User