Skip to content

Commit

Permalink
Merge pull request #560 from jikan-me/bugfix/microcaching-including-o…
Browse files Browse the repository at this point in the history
…mitted-attributes

Bugfix/microcaching including omitted attributes
  • Loading branch information
irfan-dahir authored Nov 13, 2024
2 parents 2fa3958 + b8a24dc commit f9d6f87
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions app/Http/Middleware/MicroCaching.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,13 @@ public function handle($request, Closure $next)

// if cache exists, return cache
if (Cache::has($fingerprint)) {
$response = \json_decode(Cache::get($fingerprint), true);

unset($response['meta']);
unset($response['links']);

return response()
->json(
\json_decode(Cache::get($fingerprint), true)
);
->json($response);
}

// set cache
Expand Down

0 comments on commit f9d6f87

Please sign in to comment.