mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 06:21:27 +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()
|
||||
{
|
||||
$mastodonMode = self::$mastodonMode;
|
||||
$limit = $this->query->input('limit', 20);
|
||||
$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;
|
||||
// Removed until we provide more relevent sorting/results
|
||||
return [];
|
||||
}
|
||||
|
||||
protected function resolveQuery()
|
||||
|
|
Loading…
Reference in a new issue