]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/models/account/account-blocklist.ts
Fix subscribe button responsive
[github/Chocobozzz/PeerTube.git] / server / models / account / account-blocklist.ts
index a7b8db076cd178705df0b0658d45c654cba8247e..f6212ff6e9a11e43c5ca8bb5b7f58ac44b7f7135 100644 (file)
@@ -6,7 +6,7 @@ import { AttributesOnly } from '@shared/typescript-utils'
 import { AccountBlock } from '../../../shared/models'
 import { ActorModel } from '../actor/actor'
 import { ServerModel } from '../server/server'
-import { createSafeIn, getSort, searchAttribute } from '../utils'
+import { createSafeIn, getSort, searchAttribute } from '../shared'
 import { AccountModel } from './account'
 
 @Table({
@@ -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