mirror of https://github.com/pixelfed/pixelfed.git
Update ProfileSponsorController
This commit is contained in:
parent
f22a4b2d75
commit
bd61a921e8
|
@ -10,7 +10,8 @@ class ProfileSponsorController extends Controller
|
|||
{
|
||||
public function get(Request $request, $id)
|
||||
{
|
||||
$res = ProfileSponsor::whereProfileId($id)->firstOrFail()->sponsors;
|
||||
return response($res)->header('Content-Type', 'application/json');
|
||||
$profile = ProfileSponsor::whereProfileId($id)->first();
|
||||
$res = $profile ? $profile->sponsors : [];
|
||||
return response()->json($res);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue