mirror of
https://github.com/strapi/strapi.git
synced 2025-09-22 06:50:51 +00:00
replace axiosInstance in the Roles ListPage deleteData function to replace the api call with the getFetchClient del method
This commit is contained in:
parent
c7ba51012e
commit
492cfe13ce
@ -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',
|
||||
|
Loading…
x
Reference in New Issue
Block a user