Skip to content

Instantly share code, notes, and snippets.

@gregblake
Last active February 25, 2021 12:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gregblake/cbcea07a25b40f2103b9e975e4630c47 to your computer and use it in GitHub Desktop.
Save gregblake/cbcea07a25b40f2103b9e975e4630c47 to your computer and use it in GitHub Desktop.
422 When Making a request to set the notification previews preference
  • The server responds with a 422 because the notification_preview_enabled value is required, but it is undefined on this request.
  • To resolve this bug, the client should set the notification_preview_enabled value to true by default, and the value should change when it makes another request whenever the user changes the toggle on the app.
[Thu Feb 25 2021 07:12:21.876]  LOG      AXIOS Request:  {"adapter": [Function xhrAdapter], "data": {"connect_client_preference": {"app_uuid": "3ac5d1e6a71680fe", "device_type": "Google/Android SDK built for x86", "notification_preview_enabled": undefined}}, "headers": {"Accept": "application/json", "User-Agent": "Connect {\"app_id\":\"com.powerhrg.connect.dev\",\"build_number\":1,\"os_version\":27,\"device\":\"unknown\",\"os\":\"Android\"}", "common": {"Accept": "application/json, text/plain, */*"}, "delete": {}, "get": {}, "head": {}, "patch": {"Content-Type": "application/x-www-form-urlencoded"}, "post": {"Content-Type": "application/x-www-form-urlencoded"}, "put": {"Content-Type": "application/x-www-form-urlencoded"}}, "maxBodyLength": -1, "maxContentLength": -1, "method": "put", "timeout": 0, "transformRequest": [[Function transformRequest]], "transformResponse": [[Function transformResponse]], "url": "http://192.168.0.15:3000/connect/api/v4/client_preferences/notification_previews", "validateStatus": [Function validateStatus], "xsrfCookieName": "XSRF-TOKEN", "xsrfHeaderName": "X-XSRF-TOKEN"}
[Thu Feb 25 2021 07:12:27.340]  LOG      axios response [Error: Request failed with status code 422]
[Thu Feb 25 2021 07:12:27.350]  LOG      Failed to send pushNotificationsPreviewPreferenceSetCall=
: Error: Request failed with status code 422
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment