Skip to content

Commit

Permalink
Use preloaded country data
Browse files Browse the repository at this point in the history
  • Loading branch information
nanaya committed Sep 25, 2024
1 parent 9d30f8e commit 13eae0c
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions app/Transformers/UserCompactTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ class UserCompactTransformer extends TransformerAbstract
];

const CARD_INCLUDES_PRELOAD = [
'country',
'userGroups',
];

Expand Down Expand Up @@ -193,9 +192,7 @@ public function includeCommentsCount(User $user)

public function includeCountry(User $user)
{
return $user->country === null
? $this->primitive(null)
: $this->item($user->country, new CountryTransformer());
return $this->item(app('countries')->byCode($user->country_acronym), new CountryTransformer());
}

public function includeCover(User $user)
Expand Down

0 comments on commit 13eae0c

Please sign in to comment.