mirror of
https://github.com/strapi/strapi.git
synced 2025-09-26 00:39:49 +00:00
Fix role edition
Signed-off-by: soupette <cyril.lpz@gmail.com>
This commit is contained in:
parent
4220052310
commit
cd720c26e5
@ -2,7 +2,6 @@ import React, { useState, useRef } from 'react';
|
|||||||
import { Header } from '@buffetjs/custom';
|
import { Header } from '@buffetjs/custom';
|
||||||
import { Padded } from '@buffetjs/core';
|
import { Padded } from '@buffetjs/core';
|
||||||
import { Formik } from 'formik';
|
import { Formik } from 'formik';
|
||||||
import { merge } from 'lodash';
|
|
||||||
import { useIntl } from 'react-intl';
|
import { useIntl } from 'react-intl';
|
||||||
import { useRouteMatch } from 'react-router-dom';
|
import { useRouteMatch } from 'react-router-dom';
|
||||||
import { request, useGlobalContext } from 'strapi-helper-plugin';
|
import { request, useGlobalContext } from 'strapi-helper-plugin';
|
||||||
@ -25,7 +24,7 @@ const EditPage = () => {
|
|||||||
const {
|
const {
|
||||||
params: { id },
|
params: { id },
|
||||||
} = useRouteMatch(`${settingsBaseURL}/${pluginId}/roles/:id`);
|
} = useRouteMatch(`${settingsBaseURL}/${pluginId}/roles/:id`);
|
||||||
const { permissions, routes, policies, isLoading } = usePlugins();
|
const { routes, policies, isLoading } = usePlugins();
|
||||||
const { role, isLoading: isRoleLoading, onSubmitSucceeded } = useFetchRole(id);
|
const { role, isLoading: isRoleLoading, onSubmitSucceeded } = useFetchRole(id);
|
||||||
const permissionsRef = useRef();
|
const permissionsRef = useRef();
|
||||||
|
|
||||||
@ -141,7 +140,7 @@ const EditPage = () => {
|
|||||||
{!isLoading && !isRoleLoading && (
|
{!isLoading && !isRoleLoading && (
|
||||||
<UsersPermissions
|
<UsersPermissions
|
||||||
ref={permissionsRef}
|
ref={permissionsRef}
|
||||||
permissions={merge(role.permissions, permissions)}
|
permissions={role.permissions}
|
||||||
routes={routes}
|
routes={routes}
|
||||||
policies={policies}
|
policies={policies}
|
||||||
/>
|
/>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user