X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fcontrollers%2Fapi%2Fplugins.ts;h=de9e055dc0fe4b9bf7db4b7c0a5484237a44ebc9;hb=09f3d81e0c8edebbe8f5698811ecfb165f942378;hp=2de7fe41f48e826cea5e9a8d729021a45faee500;hpb=41fb13c330de629df2d23379209e79c7af0f2e9a;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/controllers/api/plugins.ts b/server/controllers/api/plugins.ts index 2de7fe41f..de9e055dc 100644 --- a/server/controllers/api/plugins.ts +++ b/server/controllers/api/plugins.ts @@ -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) {