Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

fix(api): return array from removeSensitiveData for service applications list

Bakra77e91eca451
diff --git a/app/Http/Controllers/Api/ServiceApplicationsController.php b/app/Http/Controllers/Api/ServiceApplicationsController.php
index da3a8b3371..75a48d1120 100644
--- a/app/Http/Controllers/Api/ServiceApplicationsController.php
+++ b/app/Http/Controllers/Api/ServiceApplicationsController.php
@@ -11,6 +11,7 @@ use App\Models\Service;
use App\Models\ServiceApplication;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
+use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Validator;
use OpenApi\Attributes as OA;
@@ -25,7 +26,13 @@ class ServiceApplicationsController extends Controller
'resourceable_type',
]);
- return serializeApiResponse($serviceApplication);
+ $serialized = serializeApiResponse($serviceApplication);
+
+ if ($serialized instanceof Collection) {
+ return $serialized->all();
+ }
+
+ return (array) $serialized;
}
private function resolveService(Request $request, int $teamId): ?Service