Skip to content

Commit

Permalink
Fix createTournament
Browse files Browse the repository at this point in the history
  • Loading branch information
kylekz committed Dec 23, 2015
1 parent f3b6e0c commit 731c4ba
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Challonge/Challonge.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function getTournaments() {
*/
public function createTournament($params)
{
$response = Guzzle::post("tournaments");
$response = Guzzle::post("tournaments", $params);
return new Tournament($response->tournament);
}

Expand Down
6 changes: 3 additions & 3 deletions src/Challonge/Helpers/Guzzle.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public static function __callStatic($name, $params)
{
$path = $params[0];
$content = @$params[1];
$query['api_key'] = CHALLONGE_KEY;

if (is_null($content)) {
$content = [];
Expand All @@ -32,13 +33,12 @@ public static function __callStatic($name, $params)
throw new UnauthorizedException('Must set an API key.');
}

$content['api_key'] = CHALLONGE_KEY;

$base_uri = "https://api.challonge.com/v1/{$path}.json";
$client = new Client();

$response = $client->request($name, $base_uri, [
'query' => $content,
'query' => $query,
'form_params' => $content,
'headers' => self::buildHeaders(),
'http_errors' => false,
]);
Expand Down

0 comments on commit 731c4ba

Please sign in to comment.