Skip to content

Commit

Permalink
fix: Prevent attribute duplication
Browse files Browse the repository at this point in the history
  • Loading branch information
kyoya-de committed Oct 12, 2023
1 parent 5d4a442 commit 1946ccc
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Makaira/Connect/Repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Throwable;

use function array_unique;
use function array_values;

/**
* Class Repository
*
Expand Down Expand Up @@ -220,6 +223,11 @@ public function getChangesFromList($result, $since, $limit = 50)
(array) $this->parentAttributes[ $parentId ]['attributeFloat'],
$change->data->attributeFloat
);

$change->data->attributeStr = array_values(array_unique($change->data->attributeStr));
$change->data->attributeInt = array_values(array_unique($change->data->attributeInt));
$change->data->attributeFloat = array_values(array_unique($change->data->attributeFloat));

unset(
$change->data->tmpAttributeStr,
$change->data->tmpAttributeInt,
Expand Down

0 comments on commit 1946ccc

Please sign in to comment.