From 09071200c73f5358e1d0bfb61a274e4f2c4ec52b Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 19 Jul 2019 14:36:04 +0200 Subject: Add plugin API tests --- server/controllers/api/plugins.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'server/controllers/api') diff --git a/server/controllers/api/plugins.ts b/server/controllers/api/plugins.ts index bb410e891..de58a7350 100644 --- a/server/controllers/api/plugins.ts +++ b/server/controllers/api/plugins.ts @@ -25,6 +25,7 @@ import { ManagePlugin } from '../../../shared/models/plugins/manage-plugin.model import { logger } from '../../helpers/logger' import { listAvailablePluginsFromIndex } from '../../lib/plugins/plugin-index' import { PeertubePluginIndexList } from '../../../shared/models/plugins/peertube-plugin-index-list.model' +import { RegisteredSettings } from '../../../shared/models/plugins/register-setting.model' const pluginRouter = express.Router() @@ -103,9 +104,11 @@ export { async function listPlugins (req: express.Request, res: express.Response) { const pluginType = req.query.pluginType + const uninstalled = req.query.uninstalled const resultList = await PluginModel.listForApi({ pluginType, + uninstalled, start: req.query.start, count: req.query.count, sort: req.query.sort @@ -161,9 +164,9 @@ async function uninstallPlugin (req: express.Request, res: express.Response) { function getPluginRegisteredSettings (req: express.Request, res: express.Response) { const settings = PluginManager.Instance.getRegisteredSettings(req.params.npmName) - return res.json({ - settings - }) + const json: RegisteredSettings = { settings } + + return res.json(json) } async function updatePluginSettings (req: express.Request, res: express.Response) { -- cgit v1.2.3