Skip to content

Commit

Permalink
Merge pull request exodus4d#2 from turbofeedorglory/fix.searchendpoint
Browse files Browse the repository at this point in the history
Update ESI endpoint & auth for search
  • Loading branch information
samoneilll committed Sep 2, 2022
2 parents 784c9d8 + 4ef80c4 commit bedfb07
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions app/Client/Ccp/Esi/Esi.php
Original file line number Diff line number Diff line change
Expand Up @@ -939,10 +939,12 @@ function($body) : array {
/**
* @param array $categories
* @param string $search
* @param int $characterId
* @param string $accessToken
* @param bool $strict
* @return RequestConfig
*/
protected function searchRequest(array $categories, string $search, bool $strict = false) : RequestConfig {
protected function searchRequest(array $categories, string $search, int $characterId, string $accessToken, bool $strict = false) : RequestConfig {
$query = [
'categories' => $categories,
'search' => $search,
Expand All @@ -954,8 +956,8 @@ protected function searchRequest(array $categories, string $search, bool $strict
]);

return new RequestConfig(
WebClient::newRequest('GET', $this->getEndpointURI(['search', 'GET'])),
$this->getRequestOptions('', null, $query),
WebClient::newRequest('GET', $this->getEndpointURI(['search', 'GET'], [$characterId])),
$this->getRequestOptions($accessToken, null, $query),
function($body) : array {
$searchData = [];
if(!$body->error){
Expand Down
2 changes: 1 addition & 1 deletion app/Config/Ccp/Esi/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ class Config extends AbstractConfig {
]
],
'search' => [
'GET' => '/v2/search/'
'GET' => '/v3/characters/{x}/search/'
]
];
}

0 comments on commit bedfb07

Please sign in to comment.