Commit 1146aa6c authored by Felix Herrmann's avatar Felix Herrmann
Browse files

Merge branch 'feature/add-pagination-for-jobs-end-point' into 'master'

Add possible parameters for jobs endpoint.

See merge request riconet-public/talenstorm-api-client!3
parents 90cf567d 7566e4e7
......@@ -18,9 +18,11 @@ namespace Riconet\TalenstormApiClient;
interface ApiInterface
{
/**
* @param array $parameters
*
* @return mixed
*/
public function fetchJobs();
public function fetchJobs($parameters = []);
/**
* @param string $identification
......
......@@ -44,13 +44,21 @@ class Client implements ApiInterface
/**
* Fetches all job data.
*
* @param array $parameters
*
* @return array the parsed json response of the api
*
* @throws GuzzleException
*/
public function fetchJobs()
public function fetchJobs($parameters = [])
{
return $this->fetch('api/v1/joboffers/basic');
$encodedParameters = [];
foreach ($parameters as $key => $val) {
$encodedParameters[] = urlencode($key).'='.urlencode($val);
}
$urlParameters = count($encodedParameters) > 0 ? '?'.implode('&', $encodedParameters) : '';
return $this->fetch("api/v1/joboffers/basic$urlParameters");
}
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment