Skip to content

Commit

Permalink
fix fields in generic embed
Browse files Browse the repository at this point in the history
update test
  • Loading branch information
nwilging committed Apr 18, 2023
1 parent eb2e6af commit a5ea82b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Support/Embeds/GenericEmbed.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public function toArray(): array
'provider' => $this->provider?->toArray(),
'author' => $this->author?->toArray(),
'fields' => array_map(function (FieldEmbed $field): array {
return $field->toArray();
return $field->toArray()['field'];
}, $this->fields),
]);
}
Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/Support/Embeds/GenericEmbedTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ public function testEmbedWithAllOptions()
'thumbnail' => $thumbnail->toArray(),
'video' => $video->toArray(),
'fields' => [
$field1->toArray(),
$field2->toArray(),
$field1->toArray()['field'],
$field2->toArray()['field'],
],
], $embed->toArray());
}
Expand Down

0 comments on commit a5ea82b

Please sign in to comment.