Skip to content

Commit

Permalink
Allow empty [] when using PATCH TO_MANY relationship
Browse files Browse the repository at this point in the history
Fixes #54
  • Loading branch information
nohponex committed Nov 7, 2016
1 parent 634f42d commit e87494b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Controller/POST.php
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ protected static function getParsedRelationshipAttributes(
} elseif ($relationship->type == Relationship::TYPE_TO_MANY) {
$parsedValues = [];

if (!is_array($relationshipData)) {
if (!is_array($relationshipData) && (count((array) $relationshipData) > 0)) {
throw new RequestException(sprintf(
'Expected data to be an array for relationship "%s"',
$relationshipKey
Expand Down

0 comments on commit e87494b

Please sign in to comment.