From 53fd79fa804ad486975ae4762c0acacb5991cb4a Mon Sep 17 00:00:00 2001 From: Juan24 <93536474+juanbroder24@users.noreply.github.com> Date: Thu, 5 Jun 2025 17:57:41 -0300 Subject: [PATCH] fix_errors --- app/Http/Controllers/OrganisationController.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app/Http/Controllers/OrganisationController.php b/app/Http/Controllers/OrganisationController.php index 4e41198..85eef73 100644 --- a/app/Http/Controllers/OrganisationController.php +++ b/app/Http/Controllers/OrganisationController.php @@ -68,7 +68,7 @@ public function getAll(Request $request) { try { /** @var Collection $orgs */ - $orgs = $this->orgRepo->all(); + $orgs = $this->orgRepo->all()->load('details'); } catch (\Exception $e) { Log::error('Could not get Organisations list', ['message' => $e->getMessage()]); @@ -79,10 +79,6 @@ public function getAll(Request $request) ], 500); } - $orgs->each(function (Organisation $org) { - $org->load('details'); - }); - $resource = new \League\Fractal\Resource\Collection($orgs, new OrganisationTransformer([ 'unpublished' => $request->header('x-api-key') ? false : true, ]));