Skip to content

Commit

Permalink
UserEndpoint: Meta data can be returned directly.
Browse files Browse the repository at this point in the history
  • Loading branch information
janbarasek authored Sep 7, 2022
1 parent 1acd185 commit 69018d0
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/Api/UserEndpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -320,16 +320,7 @@ public function actionOverview(int $id): void
],
'avatarUrl' => $user->getAvatarUrl(),
'created' => $user->getCreateDate(),
'meta' => (static function (array $data): array {
$return = [];
foreach ($data as $key => $value) {
if (\is_scalar($value) === true) {
$return[$key] = $value;
}
}

return $return;
})($user->getMetaData()),
'meta' => $user->getMetaData(),
]);
}

Expand Down

0 comments on commit 69018d0

Please sign in to comment.