mirror of
https://github.com/strapi/strapi.git
synced 2026-01-08 05:04:10 +00:00
replace axiosInstance in the deleteRequest utils to replace the api calls with the getFetchClient del method
This commit is contained in:
parent
79bb5949bd
commit
ae372c8afb
@ -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({
|
||||
|
||||
@ -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);
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user