[Axios] Edited post and patch payloads

This commit is contained in:
Matej Glasnák committed 2023-01-31 15:57:26 +01:00
1 parent 9d1fd6c16b
commit 647125e7fd
1 file changed
+4 -4
+4 -4
View File
@@ -91,7 +91,7 @@ export default {
},
async patch(url: string, params = null, config?: any) {
return axios.patch(url, params, config)
return axios.patch(url, {data: params}, config)
.then(response => response.data)
.catch(error => Promise.reject(error))
},
@@ -99,13 +99,13 @@ export default {
async patch_auth(url: string, params = null, config?: any) {
config = this._config(config)
return axios.patch(url, params, config)
return axios.patch(url, {data: params}, config)
.then(response => response.data)
.catch(error => Promise.reject(error))
},
async patch_data(url: string, params = null, config?: any) {
return axios.patch(url, params, config)
return axios.patch(url, {data: params}, config)
.then(response => response.data.data)
.catch(error => Promise.reject(error.response || error))
},
@@ -113,7 +113,7 @@ export default {
async patch_auth_data(url: string, params = null, config?: any) {
config = this._config(config)
return axios.patch(url, params, config)
return axios.patch(url, {data: params}, config)
.then(response => response.data.data)
.catch(error => Promise.reject(error.response || error))
},