Add initial support for ThemePlugins

This commit is contained in:
Nick O'Leary
2021-01-26 13:35:40 +00:00
parent 8e7a230dbc
commit 1f6328bf4e
9 changed files with 127 additions and 20 deletions

View File

@@ -17,6 +17,10 @@ module.exports = {
})
} else {
opts.lang = apiUtils.determineLangFromHeaders(req.acceptsLanguages());
if (/[^a-z\-\*]/i.test(opts.lang)) {
res.json({});
return;
}
runtimeAPI.plugins.getPluginConfigs(opts).then(function(configs) {
res.send(configs);
})
@@ -28,6 +32,10 @@ module.exports = {
lang: req.query.lng,
req: apiUtils.getRequestLogObject(req)
}
if (/[^a-z\-\*]/i.test(opts.lang)) {
res.json({});
return;
}
runtimeAPI.plugins.getPluginCatalogs(opts).then(function(result) {
res.json(result);
}).catch(function(err) {