]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/models/account/account-blocklist.ts
Fix comments SQL pagination
[github/Chocobozzz/PeerTube.git] / server / models / account / account-blocklist.ts
index a7b8db076cd178705df0b0658d45c654cba8247e..377249b38608ba565a9270c1a814cb202bf54899 100644 (file)
@@ -132,6 +132,20 @@ export class AccountBlocklistModel extends Model<Partial<AttributesOnly<AccountB
             as: 'BlockedAccount'
           }
         ]
+      } else if (search) { // We need some joins when counting with search
+        query.include = [
+          {
+            model: AccountModel.unscoped(),
+            required: true,
+            as: 'BlockedAccount',
+            include: [
+              {
+                model: ActorModel.unscoped(),
+                required: true
+              }
+            ]
+          }
+        ]
       }
 
       return query