@bexis2/bexis2-core-ui 0.4.54 → 0.4.56

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.
@@ -4,7 +4,6 @@ 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);
8
7
  // Create a instance of axios to use the same base url.
9
8
  const axiosAPI = axios.create({
10
9
  baseURL: host
@@ -13,16 +12,7 @@ const apiRequest = (method, url, request) => {
13
12
  authorization: 'Basic ' + btoa(username + ':' + password)
14
13
  };
15
14
  const requestVerificationToken = csrfToken;
16
- if (method == "post" && requestVerificationToken) {
17
- // headers['__RequestVerificationToken'] = requestVerificationToken;
18
- // Set content type to application/x-www-form-urlencoded if it's application/json
19
- // because always the server expect the token in form data
20
- const contentType = headers['Content-Type'];
21
- if (contentType === 'application/json')
22
- headers['Content-Type'] = 'application/x-www-form-urlencoded';
23
- // Add the token to the request body
24
- request = { ...request, __RequestVerificationToken: requestVerificationToken };
25
- }
15
+ headers['__RequestVerificationToken'] = requestVerificationToken;
26
16
  //using the axios instance to perform the request that received from each http method
27
17
  return axiosAPI({
28
18
  method,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bexis2/bexis2-core-ui",
3
- "version": "0.4.54",
3
+ "version": "0.4.56",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "vite dev",
@@ -7,7 +7,6 @@ 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)
11
10
  // Create a instance of axios to use the same base url.
12
11
  const axiosAPI = axios.create({
13
12
  baseURL: host
@@ -19,18 +18,8 @@ const apiRequest = (method, url, request) => {
19
18
 
20
19
  const requestVerificationToken = csrfToken;
21
20
 
22
- if (method == "post" && requestVerificationToken) {
23
- // headers['__RequestVerificationToken'] = requestVerificationToken;
21
+ headers['__RequestVerificationToken'] = requestVerificationToken;
24
22
 
25
- // Set content type to application/x-www-form-urlencoded if it's application/json
26
- // because always the server expect the token in form data
27
- const contentType = headers['Content-Type'];
28
- if (contentType === 'application/json')
29
- headers['Content-Type']='application/x-www-form-urlencoded';
30
-
31
- // Add the token to the request body
32
- request = {...request, __RequestVerificationToken: requestVerificationToken};
33
- }
34
23
 
35
24
  //using the axios instance to perform the request that received from each http method
36
25
  return axiosAPI({