Skip to content

Commit

Permalink
fix: empty payload error happend in hapi plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtek-krysiak committed Jul 27, 2020
1 parent 9527a4a commit f5775dd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/backend/utils/request-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import BaseResource from '../adapters/base-resource'
* @private
*/
const RequestParser = (originalRequest: ActionRequest, resource: BaseResource): ActionRequest => {
const { payload: originalPayload = {} } = originalRequest
const { payload: originalPayload } = originalRequest

const payload = Object.entries(originalPayload).reduce((memo, [path, value]) => {
const payload = Object.entries(originalPayload || {}).reduce((memo, [path, value]) => {
const property = resource.property(path)

if (property) {
Expand Down

0 comments on commit f5775dd

Please sign in to comment.