Browse Source

Update ApiV1Controller, fix media update. Fixes #4196

Daniel Supernault 2 years ago
parent
commit
f31646502f
1 changed files with 4 additions and 1 deletions
  1. 4 1
      app/Http/Controllers/Api/ApiV1Controller.php

+ 4 - 1
app/Http/Controllers/Api/ApiV1Controller.php

@@ -1628,7 +1628,10 @@ class ApiV1Controller extends Controller
 			], 429);
 			], 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());
 	}
 	}
 
 
 	/**
 	/**