mirror of
https://github.com/pixelfed/pixelfed.git
synced 2025-01-11 14:40:46 +00:00
Update InternalApiController
This commit is contained in:
parent
aabfa6c099
commit
97bd7c7612
1 changed files with 14 additions and 0 deletions
|
@ -5,6 +5,7 @@ namespace App\Http\Controllers;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use App\{
|
use App\{
|
||||||
DirectMessage,
|
DirectMessage,
|
||||||
|
DiscoverCategory,
|
||||||
Hashtag,
|
Hashtag,
|
||||||
Follower,
|
Follower,
|
||||||
Like,
|
Like,
|
||||||
|
@ -286,4 +287,17 @@ class InternalApiController extends Controller
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function discoverCategories(Request $request)
|
||||||
|
{
|
||||||
|
$categories = DiscoverCategory::whereActive(true)->orderBy('order')->take(10)->get();
|
||||||
|
$res = $categories->map(function($item) {
|
||||||
|
return [
|
||||||
|
'name' => $item->name,
|
||||||
|
'url' => $item->url(),
|
||||||
|
'thumb' => $item->thumb()
|
||||||
|
];
|
||||||
|
});
|
||||||
|
return response()->json($res);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue