Route to get layout to apply

This commit is contained in:
Jim Laurie 2018-03-14 10:22:15 +01:00
parent adb104f666
commit b4be337249
2 changed files with 14 additions and 0 deletions

View File

@ -1,5 +1,13 @@
{
"routes": [
{
"method": "GET",
"path": "/layout",
"handler": "ContentManager.layout",
"config": {
"policies": []
}
},
{
"method": "GET",
"path": "/models",

View File

@ -7,6 +7,12 @@ const _ = require('lodash');
*/
module.exports = {
layout: async (ctx) => {
const {source} = ctx.query;
return ctx.send(_.get(strapi.plugins, [source, 'config', 'layout'], {}));
},
models: async ctx => {
const pickData = (model) => _.pick(model, [
'info',