Skip to content

Commit

Permalink
fix: make sure old adapters also work
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtek-krysiak committed Aug 27, 2020
1 parent d21ec77 commit cb0bd3f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/backend/utils/request-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ const RequestParser = (originalRequest: ActionRequest, resource: BaseResource):
if (formValue === FORM_VALUE_EMPTY_ARRAY) { value = [] }

if (property) {
// strip payload from disabled properties
if (property.isDisabled()) { return { ...memo } }
// Strip payload from disabled properties.
// isDisabled method has been added recently so this check is needed
// so adapters with older version of admin-bro will also work
if (property.isDisabled && property.isDisabled()) { return { ...memo } }

if (property.type() === 'boolean') {
if (value === 'true') { return { ...memo, [path]: true } }
Expand Down

0 comments on commit cb0bd3f

Please sign in to comment.