1
0
Fork 1
mirror of https://github.com/pixelfed/pixelfed.git synced 2024-12-24 08:44:02 +00:00

Update SearchApiV2Service

This commit is contained in:
Daniel Supernault 2020-02-07 00:26:45 -07:00
parent efa8b35877
commit 1dac65fc10
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -25,7 +25,7 @@ class SearchApiV2Service
{ {
$this->query = $query; $this->query = $query;
if($query->has('resolve') && $query->resolve == true && Helpers::validateUrl($query)) { if($query->has('resolve') && $query->resolve == true && Helpers::validateUrl(urldecode($query))) {
return [ return [
'accounts' => [ 'accounts' => [
$this->resolve() $this->resolve()
@ -39,9 +39,7 @@ class SearchApiV2Service
switch ($query->input('type')) { switch ($query->input('type')) {
case 'accounts': case 'accounts':
return [ return [
'accounts' => [ 'accounts' => $this->accounts(),
$this->accounts()
],
'hashtags' => [], 'hashtags' => [],
'statuses' => [] 'statuses' => []
]; ];
@ -49,9 +47,7 @@ class SearchApiV2Service
case 'hashtags': case 'hashtags':
return [ return [
'accounts' => [], 'accounts' => [],
'hashtags' => [ 'hashtags' => $this->hashtags(),
$this->hashtags()
],
'statuses' => [] 'statuses' => []
]; ];
break; break;
@ -59,9 +55,7 @@ class SearchApiV2Service
return [ return [
'accounts' => [], 'accounts' => [],
'hashtags' => [], 'hashtags' => [],
'statuses' => [ 'statuses' => $this->statuses()
$this->statuses()
]
]; ];
break; break;
} }