mirror of
https://github.com/YunoHost-Apps/pixelfed_ynh.git
synced 2024-09-03 20:06:04 +02:00
Update ProfileSponsorController
This commit is contained in:
parent
f22a4b2d75
commit
bd61a921e8
1 changed files with 3 additions and 2 deletions
|
@ -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…
Add table
Reference in a new issue