Update InternalApiController, add bookmarks api

pull/1506/head
Daniel Supernault 6 years ago
parent e288b45c5b
commit 4c1d35cfa2
No known key found for this signature in database
GPG Key ID: 0DEF1C662C9033F7

@ -306,4 +306,18 @@ class InternalApiController extends Controller
Cache::forget('profile:status_count:'.$profile->id);
return $status->url();
}
public function bookmarks(Request $request)
{
$statuses = Auth::user()->profile
->bookmarks()
->withCount(['likes','comments'])
->orderBy('created_at', 'desc')
->simplePaginate(10);
$resource = new Fractal\Resource\Collection($statuses, new StatusTransformer());
$res = $this->fractal->createData($resource)->toArray();
return response()->json($res);
}
}

Loading…
Cancel
Save