Skip to content

Commit

Permalink
fix(auth): cannot retrieve book information
Browse files Browse the repository at this point in the history
  • Loading branch information
craftzdog committed Nov 30, 2021
1 parent dc97f8d commit 38057ec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/search.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ public function search($query) {
$authOptions = [CURLOPT_USERPWD => "{$this->username}:{$this->password}"];

$baseUrl = "http://{$this->hostname}:{$this->port}";
$json = $wf->request( $baseUrl."/notes/?limit=20&keyword=".urlencode( $query ) , $authOptions);
$json = $wf->request($baseUrl."/notes/?limit=20&keyword=".urlencode( $query ), $authOptions);
$json = json_decode($json);
$int = 1;

foreach( $json as $sugg ):
$data = $sugg;
$noteId = $data->{'_id'};
$bookId = $data->bookId;
$book = json_decode($wf->request( $baseUrl."/".$bookId ));
$book = json_decode($wf->request($baseUrl."/".$bookId, $authOptions));
$uri = 'inkdrop://'.str_replace(':', '/', "${noteId}");
$wf->result($int.'.'.time(), $uri, $data->title, $book->name, 'icon.png');
$int++;
Expand Down

0 comments on commit 38057ec

Please sign in to comment.