@bbn/bbn 1.0.483 → 1.0.485

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/com.js CHANGED
@@ -50,7 +50,7 @@ const fetchRequest = (method, url, config = {}, aborter) => {
50
50
  headers: new Headers(config.headers || {}),
51
51
  signal: aborter === null || aborter === void 0 ? void 0 : aborter.signal,
52
52
  };
53
- const hasBody = methodsWithBody.includes(method);
53
+ const hasBody = methodsWithBody.includes(method.toUpperCase());
54
54
  if (config.data != null && hasBody) {
55
55
  // You can get fancier here (JSON, FormData, etc.)
56
56
  bbn.fn.log('DATA', config.data);
@@ -106,7 +106,7 @@ const fetchRequest = (method, url, config = {}, aborter) => {
106
106
  };
107
107
  const xhrRequest = (method, url, config = {}, aborter) => {
108
108
  const xhr = new XMLHttpRequest();
109
- const hasBody = methodsWithBody.includes(method);
109
+ const hasBody = methodsWithBody.includes(method.toUpperCase());
110
110
  const promise = new Promise((resolve, reject) => {
111
111
  xhr.open(method, url, true);
112
112
  // Set headers
@@ -333,7 +333,7 @@ const run = (method, url, config = {}, aborter) => {
333
333
  }
334
334
  url = buildURL(url, config.params);
335
335
  const wantsUploadProgress = typeof config.onUploadProgress === 'function' &&
336
- methodsWithBody.includes(method);
336
+ methodsWithBody.includes(method.toUpperCase());
337
337
  if (wantsUploadProgress) {
338
338
  // Use XHR when upload progress is requested
339
339
  return xhrRequest(method, url, config, aborter);
@@ -128,8 +128,9 @@ export default function ajax(url, datatype = null, data = null, success = null,
128
128
  let method = "get";
129
129
  if (isObject(data)) {
130
130
  if (numProperties(data) > 0) {
131
- options.data = JSON.stringify(data);
131
+ options.data = data;
132
132
  method = "post";
133
+ bbn.fn.log("POSTING", options);
133
134
  }
134
135
  }
135
136
  let loader = com.run(method, url, options)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bbn/bbn",
3
- "version": "1.0.483",
3
+ "version": "1.0.485",
4
4
  "description": "Javascript toolkit",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",