@rebuy/rebuy 1.3.5 → 1.3.6

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.
Files changed (2) hide show
  1. package/api.js +5 -3
  2. package/package.json +1 -1
package/api.js CHANGED
@@ -26,14 +26,16 @@ const makeCall = async (method, path, data, origin, options = {}) => {
26
26
  const requestUrl = new URL(url);
27
27
  const fetchOptions = options?.fetch ?? {};
28
28
 
29
- const requestData = {
30
- key: config.key,
31
- };
29
+ const requestData = {};
32
30
 
33
31
  if (typeof data == 'object' && data != null) {
34
32
  Object.assign(requestData, data);
35
33
  }
36
34
 
35
+ if (typeof config.key == 'string' && config.key.length > 0) {
36
+ Object.assign(requestData, { key: config.key });
37
+ }
38
+
37
39
  const requestObject = {
38
40
  method,
39
41
  ...fetchOptions,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rebuy/rebuy",
3
3
  "description": "This is the default library for Rebuy",
4
- "version": "1.3.5",
4
+ "version": "1.3.6",
5
5
  "license": "MIT",
6
6
  "author": "Rebuy, Inc.",
7
7
  "type": "module",