replace axiosInstance in the Roles ListPage deleteData function to replace the api call with the getFetchClient del method

This commit is contained in:
Simone Taeggi 2023-01-05 12:36:59 +01:00
parent c7ba51012e
commit 492cfe13ce

View File

@ -1,5 +1,5 @@
import { getFetchClient } from '@strapi/admin/admin/src/utils/getFetchClient';
import { getRequestURL, axiosInstance } from '../../../../utils';
import { getRequestURL } from '../../../../utils';
export const fetchData = async (toggleNotification, notifyStatus) => {
try {
@ -20,7 +20,8 @@ export const fetchData = async (toggleNotification, notifyStatus) => {
export const deleteData = async (id, toggleNotification) => {
try {
await axiosInstance.delete(`${getRequestURL('roles')}/${id}`);
const { del } = getFetchClient();
await del(`${getRequestURL('roles')}/${id}`);
} catch (error) {
toggleNotification({
type: 'warning',