aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/plugins.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-07-19 14:36:04 +0200
committerChocobozzz <chocobozzz@cpy.re>2019-07-24 10:58:16 +0200
commit09071200c73f5358e1d0bfb61a274e4f2c4ec52b (patch)
tree602749b149df1675518846dd223105196b19a557 /server/controllers/api/plugins.ts
parent9b474844e85cce916370693cc24f53339a695570 (diff)
downloadPeerTube-09071200c73f5358e1d0bfb61a274e4f2c4ec52b.tar.gz
PeerTube-09071200c73f5358e1d0bfb61a274e4f2c4ec52b.tar.zst
PeerTube-09071200c73f5358e1d0bfb61a274e4f2c4ec52b.zip
Add plugin API tests
Diffstat (limited to 'server/controllers/api/plugins.ts')
-rw-r--r--server/controllers/api/plugins.ts9
1 files changed, 6 insertions, 3 deletions
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
25import { logger } from '../../helpers/logger' 25import { logger } from '../../helpers/logger'
26import { listAvailablePluginsFromIndex } from '../../lib/plugins/plugin-index' 26import { listAvailablePluginsFromIndex } from '../../lib/plugins/plugin-index'
27import { PeertubePluginIndexList } from '../../../shared/models/plugins/peertube-plugin-index-list.model' 27import { PeertubePluginIndexList } from '../../../shared/models/plugins/peertube-plugin-index-list.model'
28import { RegisteredSettings } from '../../../shared/models/plugins/register-setting.model'
28 29
29const pluginRouter = express.Router() 30const pluginRouter = express.Router()
30 31
@@ -103,9 +104,11 @@ export {
103 104
104async function listPlugins (req: express.Request, res: express.Response) { 105async function listPlugins (req: express.Request, res: express.Response) {
105 const pluginType = req.query.pluginType 106 const pluginType = req.query.pluginType
107 const uninstalled = req.query.uninstalled
106 108
107 const resultList = await PluginModel.listForApi({ 109 const resultList = await PluginModel.listForApi({
108 pluginType, 110 pluginType,
111 uninstalled,
109 start: req.query.start, 112 start: req.query.start,
110 count: req.query.count, 113 count: req.query.count,
111 sort: req.query.sort 114 sort: req.query.sort
@@ -161,9 +164,9 @@ async function uninstallPlugin (req: express.Request, res: express.Response) {
161function getPluginRegisteredSettings (req: express.Request, res: express.Response) { 164function getPluginRegisteredSettings (req: express.Request, res: express.Response) {
162 const settings = PluginManager.Instance.getRegisteredSettings(req.params.npmName) 165 const settings = PluginManager.Instance.getRegisteredSettings(req.params.npmName)
163 166
164 return res.json({ 167 const json: RegisteredSettings = { settings }
165 settings 168
166 }) 169 return res.json(json)
167} 170}
168 171
169async function updatePluginSettings (req: express.Request, res: express.Response) { 172async function updatePluginSettings (req: express.Request, res: express.Response) {