Fix search SQL query where duplication
authorChocobozzz <me@florianbigard.com>
Mon, 23 Dec 2019 12:43:05 +0000 (13:43 +0100)
committerChocobozzz <me@florianbigard.com>
Mon, 23 Dec 2019 12:44:24 +0000 (13:44 +0100)
server/models/video/video.ts

index e58146ccf5821bc4eb39a62ef7e1c4a4ddfd0867..990c66907f1b3bf848cd04ff5ce6077a4c01cd30 100644 (file)
@@ -316,7 +316,7 @@ export type AvailableForListIDsOptions = {
     return query
   },
   [ ScopeNames.AVAILABLE_FOR_LIST_IDS ]: (options: AvailableForListIDsOptions) => {
-    const whereAnd = options.baseWhere ? options.baseWhere : []
+    const whereAnd = options.baseWhere ? [].concat(options.baseWhere) : []
 
     const query: FindOptions = {
       raw: true,