replace axiosInstance in the Roles ListPage fetchData function to replace the api call with the getFetchClient get method

This commit is contained in:
Simone Taeggi 2023-01-05 11:56:15 +01:00
parent a76b557047
commit c7ba51012e

View File

@ -1,8 +1,10 @@
import { getFetchClient } from '@strapi/admin/admin/src/utils/getFetchClient';
import { getRequestURL, axiosInstance } from '../../../../utils';
export const fetchData = async (toggleNotification, notifyStatus) => {
try {
const { data } = await axiosInstance.get(getRequestURL('roles'));
const { get } = getFetchClient();
const { data } = await get(getRequestURL('roles'));
notifyStatus('The roles have loaded successfully');
return data;