From f31646502faadc7d77f524686f7e608000544aa5 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Fri, 3 Mar 2023 21:22:35 -0700 Subject: [PATCH] Update ApiV1Controller, fix media update. Fixes #4196 --- app/Http/Controllers/Api/ApiV1Controller.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/Api/ApiV1Controller.php b/app/Http/Controllers/Api/ApiV1Controller.php index 19fef9d2..85f5f55a 100644 --- a/app/Http/Controllers/Api/ApiV1Controller.php +++ b/app/Http/Controllers/Api/ApiV1Controller.php @@ -1628,7 +1628,10 @@ class ApiV1Controller extends Controller ], 429); }; - return $this->json(MediaService::get($media->status_id)); + $fractal = new Fractal\Manager(); + $fractal->setSerializer(new ArraySerializer()); + $resource = new Fractal\Resource\Item($media, new MediaTransformer()); + return $this->json($fractal->createData($resource)->toArray()); } /**