replace axiosInstance in the deleteRequest utils to replace the api calls with the getFetchClient del method

This commit is contained in:
Simone Taeggi 2023-01-26 17:27:50 +01:00
parent 79bb5949bd
commit ae372c8afb
2 changed files with 3 additions and 6 deletions

View File

@ -53,8 +53,6 @@ export const SettingsPage = () => {
cancelToken: source.token,
});
console.log('SettingsPage GET new', getRequestUrl('settings'));
dispatch({
type: 'GET_DATA_SUCCEEDED',
data,
@ -89,7 +87,6 @@ export const SettingsPage = () => {
dispatch({ type: 'ON_SUBMIT' });
try {
console.log('SettingsPage PUT new', getRequestUrl('settings'));
await put(getRequestUrl('settings'), modifiedData);
dispatch({

View File

@ -1,9 +1,9 @@
import axiosInstance from './axiosInstance';
import { getFetchClient } from '@strapi/helper-plugin';
import getRequestUrl from './getRequestUrl';
export const deleteRequest = (type, id) => {
const { del } = getFetchClient();
const url = getRequestUrl(`/${type}/${id}`);
console.log('deleteRequest', url);
return axiosInstance.delete(url);
return del(url);
};