mirror of
https://github.com/strapi/strapi.git
synced 2025-11-13 08:38:09 +00:00
fix(admin): support new axios wrapper format
fix(content-type-builder): support new axios wrapper format
This commit is contained in:
parent
dadcc9a2b5
commit
b08987ae80
@ -103,7 +103,7 @@ const SingleTypeFormWrapper = ({ allLayoutData, children, slug }) => {
|
|||||||
setIsCreatingEntry(true);
|
setIsCreatingEntry(true);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const { data } = await axiosInstance(getRequestUrl(`${slug}${searchToSend}`), {
|
const { data } = await axiosInstance.get(getRequestUrl(`${slug}${searchToSend}`), {
|
||||||
cancelToken: source.token,
|
cancelToken: source.token,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -351,7 +351,7 @@ const DataManagerProvider = ({
|
|||||||
|
|
||||||
// Update the category
|
// Update the category
|
||||||
// TODO: remember to pass also the pluginId when you use the new get, post, put, delete methods from getFetchClient
|
// TODO: remember to pass also the pluginId when you use the new get, post, put, delete methods from getFetchClient
|
||||||
await axiosInstance({ url: requestURL, method: 'PUT', data: body });
|
await axiosInstance.put(requestURL, body);
|
||||||
|
|
||||||
// Make sure the server has restarted
|
// Make sure the server has restarted
|
||||||
await serverRestartWatcher(true);
|
await serverRestartWatcher(true);
|
||||||
@ -501,19 +501,18 @@ const DataManagerProvider = ({
|
|||||||
trackUsage('willSaveComponent');
|
trackUsage('willSaveComponent');
|
||||||
}
|
}
|
||||||
|
|
||||||
const method = isCreating ? 'POST' : 'PUT';
|
// Lock the app
|
||||||
|
lockAppWithAutoreload();
|
||||||
|
|
||||||
const baseURL = `/${endPoint}`;
|
const baseURL = `/${endPoint}`;
|
||||||
const requestURL = isCreating ? baseURL : `${baseURL}/${currentUid}`;
|
const requestURL = isCreating ? baseURL : `${baseURL}/${currentUid}`;
|
||||||
|
|
||||||
// Lock the app
|
|
||||||
lockAppWithAutoreload();
|
|
||||||
// TODO: remember to pass also the pluginId when you use the new get, post, put, delete methods from getFetchClient
|
// TODO: remember to pass also the pluginId when you use the new get, post, put, delete methods from getFetchClient
|
||||||
await axiosInstance({
|
if (isCreating) {
|
||||||
url: requestURL,
|
await axiosInstance.post(requestURL, body);
|
||||||
method,
|
} else {
|
||||||
data: body,
|
await axiosInstance.put(requestURL, body);
|
||||||
});
|
}
|
||||||
|
|
||||||
// Make sure the server has restarted
|
// Make sure the server has restarted
|
||||||
await serverRestartWatcher(true);
|
await serverRestartWatcher(true);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user