playov2-js-utilities 0.3.8 → 0.3.9

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/lib/request.js +6 -2
  2. package/package.json +1 -1
package/lib/request.js CHANGED
@@ -17,10 +17,14 @@ const playoResponseHandler = (resp, requestId) => {
17
17
  if (status === 200) {
18
18
  const { requestStatus } = data;
19
19
  LOGGER.info(requestId, data, `Api call to url to ${url} succeeded with status ${status}`);
20
- return ({ requestStatus, data });
20
+ if (!requestStatus) {
21
+ data['requestStatus'] = 1; // assume request status of 1 if any service doesn't provide requestStatus.
22
+ }
23
+ return data;
21
24
  } else {
22
25
  LOGGER.error(requestId, data, `Api call to url to ${url} failed with status : ${status}`);
23
- return Promise.reject({ requestStatus: 0, data });
26
+ data['requestStatus'] = 0;
27
+ return Promise.reject(data);
24
28
  }
25
29
  };
26
30
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "playov2-js-utilities",
3
- "version": "0.3.8",
3
+ "version": "0.3.9",
4
4
  "description": "Private package for JS utility functions",
5
5
  "main": "index.js",
6
6
  "scripts": {