@zohoim/client-sdk 1.0.0-poc15 → 1.0.0-poc17

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.
@@ -20,27 +20,33 @@ export default class BaseAPI {
20
20
  params,
21
21
  query
22
22
  } = _ref2;
23
-
24
- const _url = this.replacePathParams(url, params);
25
-
23
+ const _url = `${this.baseURL}${this.replacePathParams(url, params)}`;
26
24
  const queryString = this.buildQuery(query);
27
25
 
28
26
  if (queryString) {
29
27
  return `${_url}?${queryString}`;
30
28
  }
31
29
 
32
- return `${this.baseURL}${_url}`;
30
+ return _url;
33
31
  }
34
32
 
35
- buildQuery(object) {
36
- return new URLSearchParams(object).toString();
33
+ buildQuery(query) {
34
+ const filteredQuery = Object.entries(query).filter(_ref3 => {
35
+ let [, value] = _ref3;
36
+ return value !== undefined && value !== null && value !== '';
37
+ }).reduce((acc, _ref4) => {
38
+ let [key, value] = _ref4;
39
+ acc[key] = value;
40
+ return acc;
41
+ }, {});
42
+ return new URLSearchParams(filteredQuery).toString();
37
43
  }
38
44
 
39
- async request(_ref3) {
45
+ async request(_ref5) {
40
46
  let {
41
47
  urlConfig,
42
48
  request
43
- } = _ref3;
49
+ } = _ref5;
44
50
  const url = this.buildUrl({
45
51
  url: urlConfig.url,
46
52
  params: request.params,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohoim/client-sdk",
3
- "version": "1.0.0-poc15",
3
+ "version": "1.0.0-poc17",
4
4
  "description": "To have the client sdk for the IM",
5
5
  "main": "es/index.js",
6
6
  "module": "es/index.js",