ywana-core8 0.0.371 → 0.0.372

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ywana-core8",
3
- "version": "0.0.371",
3
+ "version": "0.0.372",
4
4
  "description": "ywana-core8",
5
5
  "author": "Ernesto Roldan Garcia",
6
6
  "license": "MIT",
@@ -1,4 +1,4 @@
1
- async function fetchAsync(method, URL, body = null, token) {
1
+ async function fetchAsync(method, URL, body = null, token, headers) {
2
2
 
3
3
  console.log('FETCH', method, URL)
4
4
 
@@ -8,7 +8,8 @@ async function fetchAsync(method, URL, body = null, token) {
8
8
  headers: {
9
9
  "Accept": "application/json",
10
10
  "Content-Type": "application/json",
11
- "x-access-token": token
11
+ "x-access-token": token,
12
+ ...headers
12
13
  },
13
14
  body
14
15
  }
@@ -39,9 +40,9 @@ export const HTTPClient = (domain, securityCtx) => {
39
40
  return fetchAsync('GET', domain + URL, undefined, token);
40
41
  },
41
42
 
42
- POST: (URL, body) => {
43
+ POST: (URL, body, headers) => {
43
44
  const token = securityCtx ? securityCtx.token() : null;
44
- return fetchAsync('POST', domain + URL, body, token);
45
+ return fetchAsync('POST', domain + URL, body, token, headers);
45
46
  },
46
47
 
47
48
  PUT: (URL, body) => {