From 492cfe13ce9dd8c3ecea7355adc112ccb1827fb2 Mon Sep 17 00:00:00 2001 From: Simone Taeggi Date: Thu, 5 Jan 2023 12:36:59 +0100 Subject: [PATCH] replace axiosInstance in the Roles ListPage deleteData function to replace the api call with the getFetchClient del method --- .../admin/src/pages/Roles/ListPage/utils/api.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/plugins/users-permissions/admin/src/pages/Roles/ListPage/utils/api.js b/packages/plugins/users-permissions/admin/src/pages/Roles/ListPage/utils/api.js index 4d1be42da0..eefb9a45d9 100644 --- a/packages/plugins/users-permissions/admin/src/pages/Roles/ListPage/utils/api.js +++ b/packages/plugins/users-permissions/admin/src/pages/Roles/ListPage/utils/api.js @@ -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',