mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-25 15:55:22 +00:00
Update DiscoverController, change api schema
This commit is contained in:
parent
789ed4b498
commit
2eea04097a
1 changed files with 8 additions and 2 deletions
|
@ -129,10 +129,16 @@ class DiscoverController extends Controller
|
||||||
$tag = $request->input('hashtag');
|
$tag = $request->input('hashtag');
|
||||||
|
|
||||||
$hashtag = Hashtag::whereName($tag)->firstOrFail();
|
$hashtag = Hashtag::whereName($tag)->firstOrFail();
|
||||||
$res['tags'] = StatusHashtagService::get($hashtag->id, $page, $end);
|
|
||||||
if($page == 1) {
|
if($page == 1) {
|
||||||
$res['follows'] = HashtagFollow::whereUserId(Auth::id())->whereHashtagId($hashtag->id)->exists();
|
$res['follows'] = HashtagFollow::whereUserId(Auth::id())
|
||||||
|
->whereHashtagId($hashtag->id)
|
||||||
|
->exists();
|
||||||
}
|
}
|
||||||
|
$res['hashtag'] = [
|
||||||
|
'name' => $hashtag->name,
|
||||||
|
'url' => $hashtag->url()
|
||||||
|
];
|
||||||
|
$res['tags'] = StatusHashtagService::get($hashtag->id, $page, $end);
|
||||||
return $res;
|
return $res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue