mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-26 00:03:16 +00:00
Update SearchApiV2Service
This commit is contained in:
parent
d15bd60d87
commit
11552d1273
1 changed files with 2 additions and 17 deletions
|
@ -161,23 +161,8 @@ class SearchApiV2Service
|
||||||
|
|
||||||
protected function statusesById()
|
protected function statusesById()
|
||||||
{
|
{
|
||||||
$mastodonMode = self::$mastodonMode;
|
// Removed until we provide more relevent sorting/results
|
||||||
$limit = $this->query->input('limit', 20);
|
return [];
|
||||||
$query = '%' . $this->query->input('q') . '%';
|
|
||||||
$operator = config('database.default') === 'pgsql' ? 'ilike' : 'like';
|
|
||||||
$results = Status::where('caption', $operator, $query)
|
|
||||||
->whereProfileId(request()->user()->profile_id)
|
|
||||||
->limit($limit)
|
|
||||||
->get()
|
|
||||||
->map(function($status) use($mastodonMode) {
|
|
||||||
return $mastodonMode ?
|
|
||||||
StatusService::getMastodon($status->id) :
|
|
||||||
StatusService::get($status->id);
|
|
||||||
})
|
|
||||||
->filter(function($status) {
|
|
||||||
return $status && isset($status['account']);
|
|
||||||
});
|
|
||||||
return $results;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function resolveQuery()
|
protected function resolveQuery()
|
||||||
|
|
Loading…
Reference in a new issue