X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fcontrollers%2Fapi%2Fplugins.ts;h=de9e055dc0fe4b9bf7db4b7c0a5484237a44ebc9;hb=1cddb979ac5ca92aa7defe75583755f4043d1338;hp=3a9ef34e8a464cce0ccb85b6b172ab14435d2df6;hpb=421ff4618da64f0849353383f690a014024c40da;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/controllers/api/plugins.ts b/server/controllers/api/plugins.ts index 3a9ef34e8..de9e055dc 100644 --- a/server/controllers/api/plugins.ts +++ b/server/controllers/api/plugins.ts @@ -1,4 +1,4 @@ -import * as express from 'express' +import express from 'express' import { logger } from '@server/helpers/logger' import { getFormattedObjects } from '@server/helpers/utils' import { listAvailablePluginsFromIndex } from '@server/lib/plugins/plugin-index' @@ -144,8 +144,13 @@ async function installPlugin (req: express.Request, res: express.Response) { const fromDisk = !!body.path const toInstall = body.npmName || body.path + + const pluginVersion = body.pluginVersion && body.npmName + ? body.pluginVersion + : undefined + try { - const plugin = await PluginManager.Instance.install(toInstall, undefined, fromDisk) + const plugin = await PluginManager.Instance.install(toInstall, pluginVersion, fromDisk) return res.json(plugin.toFormattedJSON()) } catch (err) {