mirror of
https://github.com/strapi/strapi.git
synced 2025-09-22 23:09:47 +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 { getFetchClient } from '@strapi/admin/admin/src/utils/getFetchClient';
|
||||||
import { getRequestURL, axiosInstance } from '../../../../utils';
|
import { getRequestURL } from '../../../../utils';
|
||||||
|
|
||||||
export const fetchData = async (toggleNotification, notifyStatus) => {
|
export const fetchData = async (toggleNotification, notifyStatus) => {
|
||||||
try {
|
try {
|
||||||
@ -20,7 +20,8 @@ export const fetchData = async (toggleNotification, notifyStatus) => {
|
|||||||
|
|
||||||
export const deleteData = async (id, toggleNotification) => {
|
export const deleteData = async (id, toggleNotification) => {
|
||||||
try {
|
try {
|
||||||
await axiosInstance.delete(`${getRequestURL('roles')}/${id}`);
|
const { del } = getFetchClient();
|
||||||
|
await del(`${getRequestURL('roles')}/${id}`);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
toggleNotification({
|
toggleNotification({
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user