mirror of
https://github.com/strapi/strapi.git
synced 2025-11-15 17:49:57 +00:00
Fix PR feedback
Signed-off-by: soupette <cyril.lpz@gmail.com>
This commit is contained in:
parent
a9a978466e
commit
16261bb156
@ -64,11 +64,6 @@ module.exports = {
|
|||||||
|
|
||||||
async getPermissions(ctx) {
|
async getPermissions(ctx) {
|
||||||
try {
|
try {
|
||||||
// @alexandrebodin I am removing this as it is not needed anymore
|
|
||||||
// const { lang } = ctx.query;
|
|
||||||
// const plugins = await strapi.plugins[
|
|
||||||
// 'users-permissions'
|
|
||||||
// ].services.userspermissions.getPlugins(lang);
|
|
||||||
const permissions = await strapi.plugins[
|
const permissions = await strapi.plugins[
|
||||||
'users-permissions'
|
'users-permissions'
|
||||||
].services.userspermissions.getActions();
|
].services.userspermissions.getActions();
|
||||||
|
|||||||
@ -141,7 +141,7 @@ module.exports = {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
getActions(plugins = [], withInfo = true) {
|
getActions() {
|
||||||
const generateActions = data =>
|
const generateActions = data =>
|
||||||
Object.keys(data).reduce((acc, key) => {
|
Object.keys(data).reduce((acc, key) => {
|
||||||
if (_.isFunction(data[key])) {
|
if (_.isFunction(data[key])) {
|
||||||
@ -169,10 +169,6 @@ module.exports = {
|
|||||||
controllers: {},
|
controllers: {},
|
||||||
};
|
};
|
||||||
|
|
||||||
if (withInfo) {
|
|
||||||
initialState.information = plugins.find(plugin => plugin.id === key) || {};
|
|
||||||
}
|
|
||||||
|
|
||||||
acc[key] = Object.keys(strapi.plugins[key].controllers).reduce((obj, k) => {
|
acc[key] = Object.keys(strapi.plugins[key].controllers).reduce((obj, k) => {
|
||||||
obj.controllers[k] = generateActions(strapi.plugins[key].controllers[k]);
|
obj.controllers[k] = generateActions(strapi.plugins[key].controllers[k]);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user