1
0
Fork 1
mirror of https://github.com/pixelfed/pixelfed.git synced 2024-12-26 01:36:43 +00:00

Update ApiController, fixes #1764

This commit is contained in:
Daniel Supernault 2019-10-05 21:40:27 -06:00
parent fdac53eb77
commit 1346b75887
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -1447,9 +1447,7 @@ class ApiV1Controller extends Controller
$prev = $page > 1 ? $page - 1 : 1; $prev = $page > 1 ? $page - 1 : 1;
$links = '<'.$url.'?page='.$next.'&limit='.$limit.'>; rel="next", <'.$url.'?page='.$prev.'&limit='.$limit.'>; rel="prev"'; $links = '<'.$url.'?page='.$next.'&limit='.$limit.'>; rel="next", <'.$url.'?page='.$prev.'&limit='.$limit.'>; rel="prev"';
return response() return response()->json($res, 200, ['Link' => $links]);
->header('Link', $links)
->json($res);
} }
/** /**
@ -1480,9 +1478,7 @@ class ApiV1Controller extends Controller
$prev = $page > 1 ? $page - 1 : 1; $prev = $page > 1 ? $page - 1 : 1;
$links = '<'.$url.'?page='.$next.'&limit='.$limit.'>; rel="next", <'.$url.'?page='.$prev.'&limit='.$limit.'>; rel="prev"'; $links = '<'.$url.'?page='.$next.'&limit='.$limit.'>; rel="next", <'.$url.'?page='.$prev.'&limit='.$limit.'>; rel="prev"';
return response() return response()->json($res, 200, ['Link' => $links]);
->header('Link', $links)
->json($res);
} }
/** /**