Skip to content

Commit

Permalink
Fixed API calls paths.
Browse files Browse the repository at this point in the history
  • Loading branch information
pavolbiely committed Jul 6, 2018
1 parent 7bfb0ac commit 7fdb7a6
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/Neoship.php
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ protected function sendApiRequest(string $name, string $type, array $data = [],
$data = [];
}

$url = $this->getApiUrl() . '/api/rest/' . $name . '/?' . http_build_query($params);
$url = $this->getApiUrl() . '/api/rest/' . $name . '?' . http_build_query($params);

switch ($type) {
case 'GET':
Expand All @@ -365,7 +365,7 @@ protected function sendApiRequest(string $name, string $type, array $data = [],
*/
public function apiGetLog()
{
return $this->sendApiRequest('log', 'GET');
return $this->sendApiRequest('log/', 'GET');
}


Expand Down Expand Up @@ -399,7 +399,7 @@ public function apiGetLogPage(int $page)
*/
public function apiGetUser()
{
return $this->sendApiRequest('user', 'GET');
return $this->sendApiRequest('user/', 'GET');
}


Expand All @@ -410,7 +410,7 @@ public function apiGetUser()
*/
public function apiGetState()
{
return $this->sendApiRequest('state', 'GET');
return $this->sendApiRequest('state/', 'GET');
}


Expand All @@ -421,7 +421,7 @@ public function apiGetState()
*/
public function apiGetCurrency()
{
return $this->sendApiRequest('currency', 'GET');
return $this->sendApiRequest('currency/', 'GET');
}


Expand All @@ -433,7 +433,7 @@ public function apiGetCurrency()
*/
public function apiGetStatus(int $id)
{
return $this->sendApiRequest('status', 'GET');
return $this->sendApiRequest('status/' . $id, 'GET');
}


Expand Down Expand Up @@ -494,7 +494,7 @@ public function apiPostPackagePrice(array $prices)
*/
public function apiPostPackage(Package $package)
{
return $this->sendApiRequest('package', 'POST', $package->asArray());
return $this->sendApiRequest('package/', 'POST', $package->asArray());
}


Expand Down

0 comments on commit 7fdb7a6

Please sign in to comment.