fix(api): return array from removeSensitiveData for service applications list
This commit is contained in:
parent
8ad65a0ef8
commit
a77e91eca4
1 changed files with 8 additions and 1 deletions
|
|
@ -11,6 +11,7 @@
|
|||
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 @@ private function removeSensitiveData(ServiceApplication $serviceApplication): ar
|
|||
'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
|
||||
|
|
|
|||
Loading…
Reference in a new issue