mirror of
https://github.com/strapi/strapi.git
synced 2025-11-03 03:17:11 +00:00
Fix PR feedback
Signed-off-by: soupette <cyril.lpz@gmail.com>
This commit is contained in:
parent
664be7d2db
commit
e941ab8fae
@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
||||
import Select from 'react-select';
|
||||
import { Padded } from '@buffetjs/core';
|
||||
import { useGlobalContext } from 'strapi-helper-plugin';
|
||||
import { useFetchRole } from '../../../hooks';
|
||||
import { useRolesList } from '../../../hooks';
|
||||
import styles from './utils/styles';
|
||||
import ClearIndicator from './ClearIndicator';
|
||||
import DropdownIndicator from './DropdownIndicator';
|
||||
@ -14,7 +14,7 @@ import MultiValueContainer from './MultiValueContainer';
|
||||
const SelectRoles = ({ error, isDisabled, name, onChange, value }) => {
|
||||
const { formatMessage } = useGlobalContext();
|
||||
const translatedError = error && error.id ? formatMessage(error) : null;
|
||||
const { data, isLoading } = useFetchRole();
|
||||
const { roles: data, isLoading } = useRolesList();
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
@ -1,2 +1,3 @@
|
||||
export { default as useFetchRole } from './useFetchRole';
|
||||
export { default as useRolesList } from './useRolesList';
|
||||
export { default as useFetchPermissionsLayout } from './useFetchPermissionsLayout';
|
||||
|
||||
@ -14,7 +14,7 @@ const useFetchRole = id => {
|
||||
|
||||
const fetchRole = async roleId => {
|
||||
try {
|
||||
const requestURL = roleId ? `/admin/roles/${roleId}` : '/admin/roles';
|
||||
const requestURL = `/admin/roles/${roleId}`;
|
||||
|
||||
const { data } = await request(requestURL, { method: 'GET' });
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user