Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
enjinabner committed Oct 8, 2024
1 parent 4b9802b commit da52f7a
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ public function resolve(
MetadataService $metadataService,
): mixed {
$key = 'RefreshMetadataMutation'
. ':' . Arr::get($args, 'collectionId')
. ':' . $this->encodeTokenId($args);
. ':' . ($collectionId = Arr::get($args, 'collectionId'))
. ':' . ($tokenId = $this->encodeTokenId($args));
if (RateLimiter::tooManyAttempts($key, config('enjin-platform.sync_metadata.refresh_max_attempts'))) {
throw new PlatformException(
__('enjin-platform::error.too_many_requests', ['num' => RateLimiter::availableIn($key)])
Expand All @@ -93,9 +93,9 @@ public function resolve(
'collection:id,collection_chain_id',
])->whereHas(
'collection',
fn ($query) => $query->where('collection_chain_id', Arr::get($args, 'collectionId'))
fn ($query) => $query->where('collection_chain_id', $collectionId)
)->when(
$tokenId = $this->encodeTokenId($args),
$tokenId,
fn ($query) => $query->whereHas(
'token',
fn ($query) => $query->where('token_chain_id', $tokenId)
Expand Down

0 comments on commit da52f7a

Please sign in to comment.