mirror of
https://github.com/strapi/strapi.git
synced 2025-11-12 16:22:10 +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);
|
||||
|
||||
try {
|
||||
const { data } = await axiosInstance(getRequestUrl(`${slug}${searchToSend}`), {
|
||||
const { data } = await axiosInstance.get(getRequestUrl(`${slug}${searchToSend}`), {
|
||||
cancelToken: source.token,
|
||||
});
|
||||
|
||||
|
||||
@ -351,7 +351,7 @@ const DataManagerProvider = ({
|
||||
|
||||
// Update the category
|
||||
// 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
|
||||
await serverRestartWatcher(true);
|
||||
@ -501,19 +501,18 @@ const DataManagerProvider = ({
|
||||
trackUsage('willSaveComponent');
|
||||
}
|
||||
|
||||
const method = isCreating ? 'POST' : 'PUT';
|
||||
// Lock the app
|
||||
lockAppWithAutoreload();
|
||||
|
||||
const baseURL = `/${endPoint}`;
|
||||
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
|
||||
await axiosInstance({
|
||||
url: requestURL,
|
||||
method,
|
||||
data: body,
|
||||
});
|
||||
if (isCreating) {
|
||||
await axiosInstance.post(requestURL, body);
|
||||
} else {
|
||||
await axiosInstance.put(requestURL, body);
|
||||
}
|
||||
|
||||
// Make sure the server has restarted
|
||||
await serverRestartWatcher(true);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user