playov2-js-utilities 0.3.47 → 0.3.49

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.
@@ -85,7 +85,8 @@ const notificationIds = {
85
85
  KARMA_CASHBACK: 'karma-cashback',
86
86
  ACTIVITY_QUERY_ANSWERED: 'activity-query-answered',
87
87
  ACTIVITY_REMINDER: 'activity-reminder',
88
- MESSAGE_REQUEST: 'message-request'
88
+ MESSAGE_REQUEST: 'message-request',
89
+ USER_GOALS: 'user_goals'
89
90
  };
90
91
 
91
92
  // TODO - Check targets against current value
@@ -456,6 +457,14 @@ const config = {
456
457
  type: ["push", "drawer"],
457
458
  buttons: [],
458
459
  android_channel_id: ''
460
+ },
461
+ [notificationIds.USER_GOALS]: {
462
+ category: notificationCategories.ACTIVITY,
463
+ target: "goalDetail",
464
+ title: "your goals", // get content
465
+ type: ["push", "drawer"],
466
+ buttons: [],
467
+ android_channel_id: ''
459
468
  }
460
469
  };
461
470
 
@@ -35,17 +35,17 @@ const responseHandler = (resp, requestId) => {
35
35
 
36
36
  const { status, data, config = { url: '' } } = resp;
37
37
  const { url = '' } = config;
38
- if (status === 200) {
38
+ if (status >= 200 && status < 400) {
39
39
  const { requestStatus, message = 'success' } = data;
40
40
  if (!requestStatus && requestStatus != 0) { //if the service does not provide request status
41
41
  data["requestStatus"] = 1;
42
42
  }
43
- Logger.prepareInfoLog(requestId, {requestStatus: data.requestStatus, message}, `Api call to url to ${url} succeeded with status ${status}`)
43
+ Logger.prepareInfoLog(requestId, { status, requestStatus: data.requestStatus, message }, `Api call to url to ${url} succeeded with status ${status}`)
44
44
  return data
45
45
  }
46
46
 
47
47
  else { // ideally this should not get triggered unless there is fault in calling lib itself
48
- Logger.prepareErrorLog(requestId, err.stack, "axios error");
48
+ Logger.prepareErrorLog(requestId, { response: resp }, "axios error");
49
49
  throw ({ requestStatus: 0, message: "Failed to handle response" })
50
50
  }
51
51
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "playov2-js-utilities",
3
- "version": "0.3.47",
3
+ "version": "0.3.49",
4
4
  "description": "Private package for JS utility functions",
5
5
  "main": "index.js",
6
6
  "scripts": {