@bexis2/bexis2-core-ui 0.4.50 → 0.4.51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/services/Api.js +2 -0
- package/package.json +1 -1
- package/src/lib/services/Api.ts +2 -0
package/dist/services/Api.js
CHANGED
|
@@ -4,6 +4,7 @@ import { host, username, password, errorStore, csrfToken } from '../stores/apiSt
|
|
|
4
4
|
console.log('setup axios');
|
|
5
5
|
// implement a method to execute all the request from here.
|
|
6
6
|
const apiRequest = (method, url, request) => {
|
|
7
|
+
console.log("🚀 ~ apiRequest ~ method:", method);
|
|
7
8
|
// Create a instance of axios to use the same base url.
|
|
8
9
|
const axiosAPI = axios.create({
|
|
9
10
|
baseURL: host
|
|
@@ -15,6 +16,7 @@ const apiRequest = (method, url, request) => {
|
|
|
15
16
|
if (method === 'post' && requestVerificationToken) {
|
|
16
17
|
headers['__RequestVerificationToken'] = requestVerificationToken;
|
|
17
18
|
headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
19
|
+
request = { ...request, __RequestVerificationToken: requestVerificationToken };
|
|
18
20
|
}
|
|
19
21
|
//using the axios instance to perform the request that received from each http method
|
|
20
22
|
return axiosAPI({
|
package/package.json
CHANGED
package/src/lib/services/Api.ts
CHANGED
|
@@ -7,6 +7,7 @@ console.log('setup axios');
|
|
|
7
7
|
|
|
8
8
|
// implement a method to execute all the request from here.
|
|
9
9
|
const apiRequest = (method, url, request) => {
|
|
10
|
+
console.log("🚀 ~ apiRequest ~ method:", method)
|
|
10
11
|
// Create a instance of axios to use the same base url.
|
|
11
12
|
const axiosAPI = axios.create({
|
|
12
13
|
baseURL: host
|
|
@@ -21,6 +22,7 @@ const apiRequest = (method, url, request) => {
|
|
|
21
22
|
if (method==='post' && requestVerificationToken) {
|
|
22
23
|
headers['__RequestVerificationToken'] = requestVerificationToken;
|
|
23
24
|
headers['Content-Type']='application/x-www-form-urlencoded';
|
|
25
|
+
request = {...request, __RequestVerificationToken: requestVerificationToken};
|
|
24
26
|
}
|
|
25
27
|
|
|
26
28
|
//using the axios instance to perform the request that received from each http method
|