X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fmodels%2Fserver%2Fplugin.ts;h=fa5b4cc4b3c51d9b99316712d57801ec8ea1b4dd;hb=92e66e04f7f51d37b465cff442ce47f6d6d7cadd;hp=05083e3f70847958e0c1054f66ea013180257382;hpb=d2d4a5a999746ae0f01a2ce89b844252346bab27;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/models/server/plugin.ts b/server/models/server/plugin.ts index 05083e3f7..fa5b4cc4b 100644 --- a/server/models/server/plugin.ts +++ b/server/models/server/plugin.ts @@ -239,11 +239,10 @@ export class PluginModel extends Model>> { if (options.pluginType) query.where['type'] = options.pluginType - return PluginModel - .findAndCountAll(query) - .then(({ rows, count }) => { - return { total: count, data: rows } - }) + return Promise.all([ + PluginModel.count(query), + PluginModel.findAll(query) + ]).then(([ total, data ]) => ({ total, data })) } static listInstalled (): Promise {