Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions app/Http/Controllers/Api/V1/GetBrewery.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Support\Facades\Cache;

class GetBrewery extends Controller
{
Expand All @@ -17,9 +16,7 @@ class GetBrewery extends Controller
*/
public function __invoke(Request $request, string $id): JsonResponse
{
$brewery = Cache::remember('brewery_'.$id, config('platform.cache_control_max_age'), function () use ($id) {
return new BreweryResource(Brewery::findOrFail($id));
});
$brewery = new BreweryResource(Brewery::findOrFail($id));

return response()
->json(
Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/Api/V1/GetBreweryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
$response = $this->getJson("/v1/breweries/{$brewery->id}");
$hasCache = Cache::has('brewery_'.$brewery->id);
expect($hasCache)->toBeTrue();
});
})->skip(message: 'Caching was disabled for testing.');

test('response has correct json api structure', function () {
$brewery = createBrewery();
Expand Down