mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-10 08:44:49 +00:00
Update InternalApiController
This commit is contained in:
parent
0870b72a97
commit
a774ad7373
1 changed files with 0 additions and 31 deletions
|
@ -94,37 +94,6 @@ class InternalApiController extends Controller
|
|||
return $status->url();
|
||||
}
|
||||
|
||||
public function notifications(Request $request)
|
||||
{
|
||||
$this->validate($request, [
|
||||
'page' => 'nullable|min:1|max:3',
|
||||
]);
|
||||
|
||||
$profile = Auth::user()->profile;
|
||||
$timeago = Carbon::now()->subMonths(6);
|
||||
$notifications = Notification::with('actor')
|
||||
->whereProfileId($profile->id)
|
||||
->whereDate('created_at', '>', $timeago)
|
||||
->orderBy('id', 'desc')
|
||||
->simplePaginate(30);
|
||||
$notifications = $notifications->map(function($k, $v) {
|
||||
return [
|
||||
'id' => $k->id,
|
||||
'action' => $k->action,
|
||||
'message' => $k->message,
|
||||
'rendered' => $k->rendered,
|
||||
'actor' => [
|
||||
'avatar' => $k->actor->avatarUrl(),
|
||||
'username' => $k->actor->username,
|
||||
'url' => $k->actor->url(),
|
||||
],
|
||||
'url' => $k->item->url(),
|
||||
'read_at' => $k->read_at,
|
||||
];
|
||||
});
|
||||
return response()->json($notifications, 200, [], JSON_PRETTY_PRINT);
|
||||
}
|
||||
|
||||
// deprecated
|
||||
public function discover(Request $request)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue