]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/models/server/plugin.ts
Rename studio to editor
[github/Chocobozzz/PeerTube.git] / server / models / server / plugin.ts
index 05083e3f70847958e0c1054f66ea013180257382..fa5b4cc4b3c51d9b99316712d57801ec8ea1b4dd 100644 (file)
@@ -239,11 +239,10 @@ export class PluginModel extends Model<Partial<AttributesOnly<PluginModel>>> {
 
     if (options.pluginType) query.where['type'] = options.pluginType
 
-    return PluginModel
-      .findAndCountAll<MPlugin>(query)
-      .then(({ rows, count }) => {
-        return { total: count, data: rows }
-      })
+    return Promise.all([
+      PluginModel.count(query),
+      PluginModel.findAll<MPlugin>(query)
+    ]).then(([ total, data ]) => ({ total, data }))
   }
 
   static listInstalled (): Promise<MPlugin[]> {