Fix PR feedback

Signed-off-by: soupette <cyril.lpz@gmail.com>
This commit is contained in:
soupette 2020-06-02 10:33:41 +02:00 committed by Alexandre Bodin
parent 664be7d2db
commit e941ab8fae
3 changed files with 4 additions and 3 deletions

View File

@ -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 (
<>

View File

@ -1,2 +1,3 @@
export { default as useFetchRole } from './useFetchRole';
export { default as useRolesList } from './useRolesList';
export { default as useFetchPermissionsLayout } from './useFetchPermissionsLayout';

View File

@ -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' });