Commit d939f8de authored by Aaron Tidwell's avatar Aaron Tidwell Committed by GitHub

Merge pull request #33 from Tidwell/master

2.1.1 Release PR
parents 56cc284e f2cb11ca
### 2.1.1
- Fix bug preventing match_id and participant_id passed as underscore properties for URL generation #32
### 2.1.0 ### 2.1.0
- Fix null values being returned as empty objects (#24) - Fix null values being returned as empty objects (#24)
- Add processCheckIns and abortCheckIn methods to tournament api - Add processCheckIns and abortCheckIn methods to tournament api
......
...@@ -383,7 +383,7 @@ const client = challonge.createClient({ ...@@ -383,7 +383,7 @@ const client = challonge.createClient({
<br class="clear"> <br class="clear">
<footer> <footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Mar 20 2017 22:51:32 GMT-0400 (EDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme. Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Sat May 05 2018 17:05:04 GMT-0400 (EDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer> </footer>
<script>prettyPrint();</script> <script>prettyPrint();</script>
......
...@@ -608,7 +608,7 @@ ...@@ -608,7 +608,7 @@
<td class="description last">The id of the match to get</td> <td class="description last">OR obj.match_id The id of the match to get</td>
</tr> </tr>
...@@ -677,7 +677,7 @@ ...@@ -677,7 +677,7 @@
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="api_matches.js.html">api/matches.js</a>, <a href="api_matches.js.html#line103">line 103</a> <a href="api_matches.js.html">api/matches.js</a>, <a href="api_matches.js.html#line104">line 104</a>
</li></ul></dd> </li></ul></dd>
...@@ -852,7 +852,7 @@ ...@@ -852,7 +852,7 @@
<td class="description last">The id of the match to update</td> <td class="description last">OR obj.match_id The id of the match to update</td>
</tr> </tr>
...@@ -945,7 +945,7 @@ ...@@ -945,7 +945,7 @@
<br class="clear"> <br class="clear">
<footer> <footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Mar 20 2017 22:51:32 GMT-0400 (EDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme. Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Sat May 05 2018 17:05:04 GMT-0400 (EDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer> </footer>
<script>prettyPrint();</script> <script>prettyPrint();</script>
......
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Class: Matches</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Class: Matches</h1>
<section>
<header>
<h2>Matches
<sup class="variation">options</sup>
</h2>
</header>
<article>
<div class="container-overview">
<h4 class="name" id="Matches"><span class="type-signature"></span>new Matches<span class="signature">(options)</span><span class="type-signature"></span></h4>
<div class="description">
Constructor function for the class to query Matches endpoints
<pre>
index GET tournaments/:tournament/matches
show GET tournaments/:tournament/matches/:match_id
update PUT tournaments/:tournament/matches/:match_id
</pre>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="description last">configuration options for this instance</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="api_matches.js.html">api/matches.js</a>, <a href="api_matches.js.html#line4">line 4</a>
</li></ul></dd>
</dl>
</div>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-ErrorHandler.html">ErrorHandler</a></li><li><a href="module-Util.html">Util</a></li></ul><h3>Classes</h3><ul><li><a href="Client.html">Client</a></li><li><a href="Matches_.html">Matches</a></li><li><a href="Participants.html">Participants</a></li><li><a href="Tournaments.html">Tournaments</a></li></ul><h3>Global</h3><ul><li><a href="global.html#createClientoptions">createClient</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Mar 20 2017 00:31:48 GMT-0400 (EDT)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>
\ No newline at end of file
...@@ -466,7 +466,7 @@ ...@@ -466,7 +466,7 @@
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="api_participants.js.html">api/participants.js</a>, <a href="api_participants.js.html#line165">line 165</a> <a href="api_participants.js.html">api/participants.js</a>, <a href="api_participants.js.html#line167">line 167</a>
</li></ul></dd> </li></ul></dd>
...@@ -637,7 +637,7 @@ ...@@ -637,7 +637,7 @@
<td class="description last">The id of the participant to remove</td> <td class="description last">OR obj.participant_id The id of the participant to remove</td>
</tr> </tr>
...@@ -922,7 +922,7 @@ ...@@ -922,7 +922,7 @@
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="api_participants.js.html">api/participants.js</a>, <a href="api_participants.js.html#line192">line 192</a> <a href="api_participants.js.html">api/participants.js</a>, <a href="api_participants.js.html#line195">line 195</a>
</li></ul></dd> </li></ul></dd>
...@@ -1309,7 +1309,7 @@ ...@@ -1309,7 +1309,7 @@
<td class="description last">The id of the participant to get</td> <td class="description last">OR obj.participant_id The id of the participant to get</td>
</tr> </tr>
...@@ -1378,7 +1378,7 @@ ...@@ -1378,7 +1378,7 @@
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="api_participants.js.html">api/participants.js</a>, <a href="api_participants.js.html#line136">line 136</a> <a href="api_participants.js.html">api/participants.js</a>, <a href="api_participants.js.html#line137">line 137</a>
</li></ul></dd> </li></ul></dd>
...@@ -1552,7 +1552,7 @@ ...@@ -1552,7 +1552,7 @@
<td class="description last">The id of the participant to update</td> <td class="description last">OR obj.participant_id The id of the participant to update</td>
</tr> </tr>
...@@ -1645,7 +1645,7 @@ ...@@ -1645,7 +1645,7 @@
<br class="clear"> <br class="clear">
<footer> <footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Mar 20 2017 22:51:32 GMT-0400 (EDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme. Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Sat May 05 2018 17:05:04 GMT-0400 (EDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer> </footer>
<script>prettyPrint();</script> <script>prettyPrint();</script>
......
...@@ -2356,7 +2356,7 @@ ...@@ -2356,7 +2356,7 @@
<br class="clear"> <br class="clear">
<footer> <footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Mar 20 2017 22:51:32 GMT-0400 (EDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme. Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Sat May 05 2018 17:05:04 GMT-0400 (EDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer> </footer>
<script>prettyPrint();</script> <script>prettyPrint();</script>
......
...@@ -95,6 +95,11 @@ Client.prototype.setSubdomain = function(subdomain) { ...@@ -95,6 +95,11 @@ Client.prototype.setSubdomain = function(subdomain) {
} }
}; };
Client.prototype.convertCamelToUnderscoreProperties = function(obj) {
obj = util.convert(obj, util.camelToUnderscore);
return obj;
};
// cleans the passed in object, generates the API url/query-string, makes the request, delegates errors and calls callbacks // cleans the passed in object, generates the API url/query-string, makes the request, delegates errors and calls callbacks
Client.prototype.makeRequest = function(obj) { Client.prototype.makeRequest = function(obj) {
const self = this; const self = this;
...@@ -107,7 +112,7 @@ Client.prototype.makeRequest = function(obj) { ...@@ -107,7 +112,7 @@ Client.prototype.makeRequest = function(obj) {
let path = obj.path; let path = obj.path;
// normalize the rest of the properties // normalize the rest of the properties
obj = util.convert(obj, util.camelToUnderscore); obj = this.convertCamelToUnderscoreProperties(obj);
// Add on the api key // Add on the api key
obj.api_key = this.options.get('apiKey'); obj.api_key = this.options.get('apiKey');
...@@ -175,7 +180,7 @@ Client.prototype.makeRequest = function(obj) { ...@@ -175,7 +180,7 @@ Client.prototype.makeRequest = function(obj) {
<br class="clear"> <br class="clear">
<footer> <footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Mar 20 2017 22:51:32 GMT-0400 (EDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme. Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Sat May 05 2018 17:05:04 GMT-0400 (EDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer> </footer>
<script>prettyPrint();</script> <script>prettyPrint();</script>
......
...@@ -120,7 +120,7 @@ exports.handle = function(res, resData, callback, format) { ...@@ -120,7 +120,7 @@ exports.handle = function(res, resData, callback, format) {
<br class="clear"> <br class="clear">
<footer> <footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Mar 20 2017 22:51:32 GMT-0400 (EDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme. Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Sat May 05 2018 17:05:04 GMT-0400 (EDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer> </footer>
<script>prettyPrint();</script> <script>prettyPrint();</script>
......
...@@ -89,7 +89,7 @@ Matches.prototype.index = function(obj) { ...@@ -89,7 +89,7 @@ Matches.prototype.index = function(obj) {
* @memberof Matches * @memberof Matches
* @param {object} obj params to pass to the api request * @param {object} obj params to pass to the api request
* @param {string} obj.id The url of the tournament to get the match from * @param {string} obj.id The url of the tournament to get the match from
* @param {string} obj.matchId The id of the match to get * @param {string} obj.matchId OR obj.match_id The id of the match to get
* @param {function} obj.callback A method to call when the API returns. Arguments are (error, data) * @param {function} obj.callback A method to call when the API returns. Arguments are (error, data)
* @description * @description
* Retrieve a single match record for a tournament. * Retrieve a single match record for a tournament.
...@@ -106,9 +106,10 @@ client.matches.show({ ...@@ -106,9 +106,10 @@ client.matches.show({
*/ */
Matches.prototype.show = function(obj) { Matches.prototype.show = function(obj) {
obj.path = '/' + this.options.get('subdomain') + obj.id + '/matches/' + obj.matchId; obj = this.convertCamelToUnderscoreProperties(obj);
obj.path = '/' + this.options.get('subdomain') + obj.id + '/matches/' + obj.match_id;
delete obj.id; delete obj.id;
delete obj.matchId; delete obj.match_id;
obj.method = 'GET'; obj.method = 'GET';
this.makeRequest(obj); this.makeRequest(obj);
}; };
...@@ -118,7 +119,7 @@ Matches.prototype.show = function(obj) { ...@@ -118,7 +119,7 @@ Matches.prototype.show = function(obj) {
* @memberof Matches * @memberof Matches
* @param {object} obj params to pass to the api request * @param {object} obj params to pass to the api request
* @param {string} obj.id The url of the tournament to update the match in * @param {string} obj.id The url of the tournament to update the match in
* @param {string} obj.matchId The id of the match to update * @param {string} obj.matchId OR obj.match_id The id of the match to update
* @param {object} obj.match The match object with updates. See challonge docs for available properties. * @param {object} obj.match The match object with updates. See challonge docs for available properties.
* @param {function} obj.callback A method to call when the API returns. Arguments are (error, data) * @param {function} obj.callback A method to call when the API returns. Arguments are (error, data)
* @description * @description
...@@ -140,9 +141,10 @@ client.matches.update({ ...@@ -140,9 +141,10 @@ client.matches.update({
*/ */
Matches.prototype.update = function(obj) { Matches.prototype.update = function(obj) {
obj.path = '/' + this.options.get('subdomain') + obj.id + '/matches/' + obj.matchId; obj = this.convertCamelToUnderscoreProperties(obj);
obj.path = '/' + this.options.get('subdomain') + obj.id + '/matches/' + obj.match_id;
delete obj.id; delete obj.id;
delete obj.matchId; delete obj.match_id;
obj.method = 'PUT'; obj.method = 'PUT';
this.makeRequest(obj); this.makeRequest(obj);
}; };
...@@ -158,7 +160,7 @@ Matches.prototype.update = function(obj) { ...@@ -158,7 +160,7 @@ Matches.prototype.update = function(obj) {
<br class="clear"> <br class="clear">
<footer> <footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Mar 20 2017 22:51:32 GMT-0400 (EDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme. Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Sat May 05 2018 17:05:04 GMT-0400 (EDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer> </footer>
<script>prettyPrint();</script> <script>prettyPrint();</script>
......
...@@ -123,7 +123,7 @@ Participants.prototype.create = function(obj) { ...@@ -123,7 +123,7 @@ Participants.prototype.create = function(obj) {
* @memberof Participants * @memberof Participants
* @param {object} obj params to pass to the api request * @param {object} obj params to pass to the api request
* @param {string} obj.id The url of the tournament to get a participant in * @param {string} obj.id The url of the tournament to get a participant in
* @param {string} obj.participantId The id of the participant to get * @param {string} obj.participantId OR obj.participant_id The id of the participant to get
* @param {function} obj.callback A method to call when the API returns. Arguments are (error, data) * @param {function} obj.callback A method to call when the API returns. Arguments are (error, data)
* @description * @description
* Retrieve a single participant record for a tournament. * Retrieve a single participant record for a tournament.
...@@ -140,9 +140,10 @@ client.participants.show({ ...@@ -140,9 +140,10 @@ client.participants.show({
*/ */
Participants.prototype.show = function(obj) { Participants.prototype.show = function(obj) {
obj.path = '/' + this.options.get('subdomain') + obj.id + '/participants/' + obj.participantId; obj = this.convertCamelToUnderscoreProperties(obj);
obj.path = '/' + this.options.get('subdomain') + obj.id + '/participants/' + obj.participant_id;
delete obj.id; delete obj.id;
delete obj.participantId; delete obj.participant_id;
obj.method = 'GET'; obj.method = 'GET';
this.makeRequest(obj); this.makeRequest(obj);
}; };
...@@ -152,7 +153,7 @@ Participants.prototype.show = function(obj) { ...@@ -152,7 +153,7 @@ Participants.prototype.show = function(obj) {
* @memberof Participants * @memberof Participants
* @param {object} obj params to pass to the api request * @param {object} obj params to pass to the api request
* @param {string} obj.id The url of the tournament to update a participant in * @param {string} obj.id The url of the tournament to update a participant in
* @param {string} obj.participantId The id of the participant to update * @param {string} obj.participantId OR obj.participant_id The id of the participant to update
* @param {object} obj.participant The participant object with updates. See challonge docs for available properties. * @param {object} obj.participant The participant object with updates. See challonge docs for available properties.
* @param {function} obj.callback A method to call when the API returns. Arguments are (error, data) * @param {function} obj.callback A method to call when the API returns. Arguments are (error, data)
* @description * @description
...@@ -173,9 +174,10 @@ client.participants.update({ ...@@ -173,9 +174,10 @@ client.participants.update({
*/ */
Participants.prototype.update = function(obj) { Participants.prototype.update = function(obj) {
obj.path = '/' + this.options.get('subdomain') + obj.id + '/participants/' + obj.participantId; obj = this.convertCamelToUnderscoreProperties(obj);
obj.path = '/' + this.options.get('subdomain') + obj.id + '/participants/' + obj.participant_id;
delete obj.id; delete obj.id;
delete obj.participantId; delete obj.participant_id;
obj.method = 'PUT'; obj.method = 'PUT';
this.makeRequest(obj); this.makeRequest(obj);
}; };
...@@ -185,7 +187,7 @@ Participants.prototype.update = function(obj) { ...@@ -185,7 +187,7 @@ Participants.prototype.update = function(obj) {
* @memberof Participants * @memberof Participants
* @param {object} obj params to pass to the api request * @param {object} obj params to pass to the api request
* @param {string} obj.id The url of the tournament to remove a participant from * @param {string} obj.id The url of the tournament to remove a participant from
* @param {string} obj.participantId The id of the participant to remove * @param {string} obj.participantId OR obj.participant_id The id of the participant to remove
* @param {function} obj.callback A method to call when the API returns. Arguments are (error, data) * @param {function} obj.callback A method to call when the API returns. Arguments are (error, data)
* @description * @description
* If the tournament has not started, delete a participant, automatically filling in the abandoned seed number. If tournament is underway, mark a participant inactive, automatically forfeiting his/her remaining matches. * If the tournament has not started, delete a participant, automatically filling in the abandoned seed number. If tournament is underway, mark a participant inactive, automatically forfeiting his/her remaining matches.
...@@ -202,9 +204,10 @@ client.participants.destroy({ ...@@ -202,9 +204,10 @@ client.participants.destroy({
*/ */
Participants.prototype.destroy = function(obj) { Participants.prototype.destroy = function(obj) {
obj.path = '/' + this.options.get('subdomain') + obj.id + '/participants/' + obj.participantId; obj = this.convertCamelToUnderscoreProperties(obj);
obj.path = '/' + this.options.get('subdomain') + obj.id + '/participants/' + obj.participant_id;
delete obj.id; delete obj.id;
delete obj.participantId; delete obj.participant_id;
obj.method = 'DELETE'; obj.method = 'DELETE';
this.makeRequest(obj); this.makeRequest(obj);
}; };
...@@ -246,7 +249,7 @@ Participants.prototype.randomize = function(obj) { ...@@ -246,7 +249,7 @@ Participants.prototype.randomize = function(obj) {
<br class="clear"> <br class="clear">
<footer> <footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Mar 20 2017 22:51:32 GMT-0400 (EDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme. Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Sat May 05 2018 17:05:04 GMT-0400 (EDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer> </footer>
<script>prettyPrint();</script> <script>prettyPrint();</script>
......
...@@ -361,7 +361,7 @@ Tournaments.prototype.abortCheckIn = function(obj) { ...@@ -361,7 +361,7 @@ Tournaments.prototype.abortCheckIn = function(obj) {
<br class="clear"> <br class="clear">
<footer> <footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Mar 20 2017 22:51:32 GMT-0400 (EDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme. Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Sat May 05 2018 17:05:04 GMT-0400 (EDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer> </footer>
<script>prettyPrint();</script> <script>prettyPrint();</script>
......
...@@ -89,7 +89,7 @@ exports.createClient = function createClient(options) { ...@@ -89,7 +89,7 @@ exports.createClient = function createClient(options) {
<br class="clear"> <br class="clear">
<footer> <footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Mar 20 2017 22:51:32 GMT-0400 (EDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme. Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Sat May 05 2018 17:05:04 GMT-0400 (EDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer> </footer>
<script>prettyPrint();</script> <script>prettyPrint();</script>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -450,7 +450,7 @@ const client = challonge.createClient({ ...@@ -450,7 +450,7 @@ const client = challonge.createClient({
<br class="clear"> <br class="clear">
<footer> <footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Mar 20 2017 22:51:32 GMT-0400 (EDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme. Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Sat May 05 2018 17:05:04 GMT-0400 (EDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer> </footer>
<script>prettyPrint();</script> <script>prettyPrint();</script>
......
...@@ -103,7 +103,7 @@ client.tournaments.create({ ...@@ -103,7 +103,7 @@ client.tournaments.create({
<br class="clear"> <br class="clear">
<footer> <footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Mar 20 2017 22:51:32 GMT-0400 (EDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme. Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Sat May 05 2018 17:05:04 GMT-0400 (EDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer> </footer>
<script>prettyPrint();</script> <script>prettyPrint();</script>
......
...@@ -366,7 +366,7 @@ ...@@ -366,7 +366,7 @@
<br class="clear"> <br class="clear">
<footer> <footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Mar 20 2017 22:51:32 GMT-0400 (EDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme. Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Sat May 05 2018 17:05:04 GMT-0400 (EDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer> </footer>
<script>prettyPrint();</script> <script>prettyPrint();</script>
......
...@@ -857,7 +857,7 @@ ...@@ -857,7 +857,7 @@
<br class="clear"> <br class="clear">
<footer> <footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Mar 20 2017 22:51:32 GMT-0400 (EDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme. Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Sat May 05 2018 17:05:04 GMT-0400 (EDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer> </footer>
<script>prettyPrint();</script> <script>prettyPrint();</script>
......
...@@ -107,7 +107,7 @@ module.exports = serialize; ...@@ -107,7 +107,7 @@ module.exports = serialize;
<br class="clear"> <br class="clear">
<footer> <footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Mar 20 2017 22:51:32 GMT-0400 (EDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme. Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Sat May 05 2018 17:05:04 GMT-0400 (EDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer> </footer>
<script>prettyPrint();</script> <script>prettyPrint();</script>
......
@font-face {
font-family: 'Open Sans';
font-weight: normal;
font-style: normal;
src: url('../fonts/OpenSans-Regular-webfont.eot');
src:
local('Open Sans'),
local('OpenSans'),
url('../fonts/OpenSans-Regular-webfont.eot?#iefix') format('embedded-opentype'),
url('../fonts/OpenSans-Regular-webfont.woff') format('woff'),
url('../fonts/OpenSans-Regular-webfont.svg#open_sansregular') format('svg');
}
@font-face {
font-family: 'Open Sans Light';
font-weight: normal;
font-style: normal;
src: url('../fonts/OpenSans-Light-webfont.eot');
src:
local('Open Sans Light'),
local('OpenSans Light'),
url('../fonts/OpenSans-Light-webfont.eot?#iefix') format('embedded-opentype'),
url('../fonts/OpenSans-Light-webfont.woff') format('woff'),
url('../fonts/OpenSans-Light-webfont.svg#open_sanslight') format('svg');
}
html
{
overflow: auto;
background-color: #fff;
font-size: 14px;
}
body
{
font-family: 'Open Sans', sans-serif;
line-height: 1.5;
color: #4d4e53;
background-color: white;
}
a, a:visited, a:active {
color: #0095dd;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
header
{
display: block;
padding: 0px 4px;
}
tt, code, kbd, samp {
font-family: Consolas, Monaco, 'Andale Mono', monospace;
}
.class-description {
font-size: 130%;
line-height: 140%;
margin-bottom: 1em;
margin-top: 1em;
}
.class-description:empty {
margin: 0;
}
#main {
float: left;
width: 70%;
}
article dl {
margin-bottom: 40px;
}
section
{
display: block;
background-color: #fff;
padding: 12px 24px;
border-bottom: 1px solid #ccc;
margin-right: 30px;
}
.variation {
display: none;
}
.signature-attributes {
font-size: 60%;
color: #aaa;
font-style: italic;
font-weight: lighter;
}
nav
{
display: block;
float: right;
margin-top: 28px;
width: 30%;
box-sizing: border-box;
border-left: 1px solid #ccc;
padding-left: 16px;
}
nav ul {
font-family: 'Lucida Grande', 'Lucida Sans Unicode', arial, sans-serif;
font-size: 100%;
line-height: 17px;
padding: 0;
margin: 0;
list-style-type: none;
}
nav ul a, nav ul a:visited, nav ul a:active {
font-family: Consolas, Monaco, 'Andale Mono', monospace;
line-height: 18px;
color: #4D4E53;
}
nav h3 {
margin-top: 12px;
}
nav li {
margin-top: 6px;
}
footer {
display: block;
padding: 6px;
margin-top: 12px;
font-style: italic;
font-size: 90%;
}
h1, h2, h3, h4 {
font-weight: 200;
margin: 0;
}
h1
{
font-family: 'Open Sans Light', sans-serif;
font-size: 48px;
letter-spacing: -2px;
margin: 12px 24px 20px;
}
h2, h3.subsection-title
{
font-size: 30px;
font-weight: 700;
letter-spacing: -1px;
margin-bottom: 12px;
}
h3
{
font-size: 24px;
letter-spacing: -0.5px;
margin-bottom: 12px;
}
h4
{
font-size: 18px;
letter-spacing: -0.33px;
margin-bottom: 12px;
color: #4d4e53;
}
h5, .container-overview .subsection-title
{
font-size: 120%;
font-weight: bold;
letter-spacing: -0.01em;
margin: 8px 0 3px 0;
}
h6
{
font-size: 100%;
letter-spacing: -0.01em;
margin: 6px 0 3px 0;
font-style: italic;
}
table
{
border-spacing: 0;
border: 0;
border-collapse: collapse;
}
td, th
{
border: 1px solid #ddd;
margin: 0px;
text-align: left;
vertical-align: top;
padding: 4px 6px;
display: table-cell;
}
thead tr
{
background-color: #ddd;
font-weight: bold;
}
th { border-right: 1px solid #aaa; }
tr > th:last-child { border-right: 1px solid #ddd; }
.ancestors { color: #999; }
.ancestors a
{
color: #999 !important;
text-decoration: none;
}
.clear
{
clear: both;
}
.important
{
font-weight: bold;
color: #950B02;
}
.yes-def {
text-indent: -1000px;
}
.type-signature {
color: #aaa;
}
.name, .signature {
font-family: Consolas, Monaco, 'Andale Mono', monospace;
}
.details { margin-top: 14px; border-left: 2px solid #DDD; }
.details dt { width: 120px; float: left; padding-left: 10px; padding-top: 6px; }
.details dd { margin-left: 70px; }
.details ul { margin: 0; }
.details ul { list-style-type: none; }
.details li { margin-left: 30px; padding-top: 6px; }
.details pre.prettyprint { margin: 0 }
.details .object-value { padding-top: 0; }
.description {
margin-bottom: 1em;
margin-top: 1em;
}
.code-caption
{
font-style: italic;
font-size: 107%;
margin: 0;
}
.prettyprint
{
border: 1px solid #ddd;
width: 80%;
overflow: auto;
}
.prettyprint.source {
width: inherit;
}
.prettyprint code
{
font-size: 100%;
line-height: 18px;
display: block;
padding: 4px 12px;
margin: 0;
background-color: #fff;
color: #4D4E53;
}
.prettyprint code span.line
{
display: inline-block;
}
.prettyprint.linenums
{
padding-left: 70px;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.prettyprint.linenums ol
{
padding-left: 0;
}
.prettyprint.linenums li
{
border-left: 3px #ddd solid;
}
.prettyprint.linenums li.selected,
.prettyprint.linenums li.selected *
{
background-color: lightyellow;
}
.prettyprint.linenums li *
{
-webkit-user-select: text;
-moz-user-select: text;
-ms-user-select: text;
user-select: text;
}
.params .name, .props .name, .name code {
color: #4D4E53;
font-family: Consolas, Monaco, 'Andale Mono', monospace;
font-size: 100%;
}
.params td.description > p:first-child,
.props td.description > p:first-child
{
margin-top: 0;
padding-top: 0;
}
.params td.description > p:last-child,
.props td.description > p:last-child
{
margin-bottom: 0;
padding-bottom: 0;
}
.disabled {
color: #454545;
}
/* JSDoc prettify.js theme */
/* plain text */
.pln {
color: #000000;
font-weight: normal;
font-style: normal;
}
/* string content */
.str {
color: #006400;
font-weight: normal;
font-style: normal;
}
/* a keyword */
.kwd {
color: #000000;
font-weight: bold;
font-style: normal;
}
/* a comment */
.com {
font-weight: normal;
font-style: italic;
}
/* a type name */
.typ {
color: #000000;
font-weight: normal;
font-style: normal;
}
/* a literal value */
.lit {
color: #006400;
font-weight: normal;
font-style: normal;
}
/* punctuation */
.pun {
color: #000000;
font-weight: bold;
font-style: normal;
}
/* lisp open bracket */
.opn {
color: #000000;
font-weight: bold;
font-style: normal;
}
/* lisp close bracket */
.clo {
color: #000000;
font-weight: bold;
font-style: normal;
}
/* a markup tag name */
.tag {
color: #006400;
font-weight: normal;
font-style: normal;
}
/* a markup attribute name */
.atn {
color: #006400;
font-weight: normal;
font-style: normal;
}
/* a markup attribute value */
.atv {
color: #006400;
font-weight: normal;
font-style: normal;
}
/* a declaration */
.dec {
color: #000000;
font-weight: bold;
font-style: normal;
}
/* a variable name */
.var {
color: #000000;
font-weight: normal;
font-style: normal;
}
/* a function name */
.fun {
color: #000000;
font-weight: bold;
font-style: normal;
}
/* Specify class=linenums on a pre to get line numbering */
ol.linenums {
margin-top: 0;
margin-bottom: 0;
}
/* Tomorrow Theme */
/* Original theme - https://github.com/chriskempson/tomorrow-theme */
/* Pretty printing styles. Used with prettify.js. */
/* SPAN elements with the classes below are added by prettyprint. */
/* plain text */
.pln {
color: #4d4d4c; }
@media screen {
/* string content */
.str {
color: #718c00; }
/* a keyword */
.kwd {
color: #8959a8; }
/* a comment */
.com {
color: #8e908c; }
/* a type name */
.typ {
color: #4271ae; }
/* a literal value */
.lit {
color: #f5871f; }
/* punctuation */
.pun {
color: #4d4d4c; }
/* lisp open bracket */
.opn {
color: #4d4d4c; }
/* lisp close bracket */
.clo {
color: #4d4d4c; }
/* a markup tag name */
.tag {
color: #c82829; }
/* a markup attribute name */
.atn {
color: #f5871f; }
/* a markup attribute value */
.atv {
color: #3e999f; }
/* a declaration */
.dec {
color: #f5871f; }
/* a variable name */
.var {
color: #c82829; }
/* a function name */
.fun {
color: #4271ae; } }
/* Use higher contrast and text-weight for printable form. */
@media print, projection {
.str {
color: #060; }
.kwd {
color: #006;
font-weight: bold; }
.com {
color: #600;
font-style: italic; }
.typ {
color: #404;
font-weight: bold; }
.lit {
color: #044; }
.pun, .opn, .clo {
color: #440; }
.tag {
color: #006;
font-weight: bold; }
.atn {
color: #404; }
.atv {
color: #060; } }
/* Style */
/*
pre.prettyprint {
background: white;
font-family: Consolas, Monaco, 'Andale Mono', monospace;
font-size: 12px;
line-height: 1.5;
border: 1px solid #ccc;
padding: 10px; }
*/
/* Specify class=linenums on a pre to get line numbering */
ol.linenums {
margin-top: 0;
margin-bottom: 0; }
/* IE indents via margin-left */
li.L0,
li.L1,
li.L2,
li.L3,
li.L4,
li.L5,
li.L6,
li.L7,
li.L8,
li.L9 {
/* */ }
/* Alternate shading for lines */
li.L1,
li.L3,
li.L5,
li.L7,
li.L9 {
/* */ }
...@@ -121,7 +121,7 @@ module.exports = { ...@@ -121,7 +121,7 @@ module.exports = {
<br class="clear"> <br class="clear">
<footer> <footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Mar 20 2017 22:51:32 GMT-0400 (EDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme. Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Sat May 05 2018 17:05:04 GMT-0400 (EDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer> </footer>
<script>prettyPrint();</script> <script>prettyPrint();</script>
......
...@@ -56,6 +56,11 @@ Client.prototype.setSubdomain = function(subdomain) { ...@@ -56,6 +56,11 @@ Client.prototype.setSubdomain = function(subdomain) {
} }
}; };
Client.prototype.convertCamelToUnderscoreProperties = function(obj) {
obj = util.convert(obj, util.camelToUnderscore);
return obj;
};
// cleans the passed in object, generates the API url/query-string, makes the request, delegates errors and calls callbacks // cleans the passed in object, generates the API url/query-string, makes the request, delegates errors and calls callbacks
Client.prototype.makeRequest = function(obj) { Client.prototype.makeRequest = function(obj) {
const self = this; const self = this;
...@@ -68,7 +73,7 @@ Client.prototype.makeRequest = function(obj) { ...@@ -68,7 +73,7 @@ Client.prototype.makeRequest = function(obj) {
let path = obj.path; let path = obj.path;
// normalize the rest of the properties // normalize the rest of the properties
obj = util.convert(obj, util.camelToUnderscore); obj = this.convertCamelToUnderscoreProperties(obj);
// Add on the api key // Add on the api key
obj.api_key = this.options.get('apiKey'); obj.api_key = this.options.get('apiKey');
......
...@@ -50,7 +50,7 @@ Matches.prototype.index = function(obj) { ...@@ -50,7 +50,7 @@ Matches.prototype.index = function(obj) {
* @memberof Matches * @memberof Matches
* @param {object} obj params to pass to the api request * @param {object} obj params to pass to the api request
* @param {string} obj.id The url of the tournament to get the match from * @param {string} obj.id The url of the tournament to get the match from
* @param {string} obj.matchId The id of the match to get * @param {string} obj.matchId OR obj.match_id The id of the match to get
* @param {function} obj.callback A method to call when the API returns. Arguments are (error, data) * @param {function} obj.callback A method to call when the API returns. Arguments are (error, data)
* @description * @description
* Retrieve a single match record for a tournament. * Retrieve a single match record for a tournament.
...@@ -67,9 +67,10 @@ client.matches.show({ ...@@ -67,9 +67,10 @@ client.matches.show({
*/ */
Matches.prototype.show = function(obj) { Matches.prototype.show = function(obj) {
obj.path = '/' + this.options.get('subdomain') + obj.id + '/matches/' + obj.matchId; obj = this.convertCamelToUnderscoreProperties(obj);
obj.path = '/' + this.options.get('subdomain') + obj.id + '/matches/' + obj.match_id;
delete obj.id; delete obj.id;
delete obj.matchId; delete obj.match_id;
obj.method = 'GET'; obj.method = 'GET';
this.makeRequest(obj); this.makeRequest(obj);
}; };
...@@ -79,7 +80,7 @@ Matches.prototype.show = function(obj) { ...@@ -79,7 +80,7 @@ Matches.prototype.show = function(obj) {
* @memberof Matches * @memberof Matches
* @param {object} obj params to pass to the api request * @param {object} obj params to pass to the api request
* @param {string} obj.id The url of the tournament to update the match in * @param {string} obj.id The url of the tournament to update the match in
* @param {string} obj.matchId The id of the match to update * @param {string} obj.matchId OR obj.match_id The id of the match to update
* @param {object} obj.match The match object with updates. See challonge docs for available properties. * @param {object} obj.match The match object with updates. See challonge docs for available properties.
* @param {function} obj.callback A method to call when the API returns. Arguments are (error, data) * @param {function} obj.callback A method to call when the API returns. Arguments are (error, data)
* @description * @description
...@@ -101,9 +102,10 @@ client.matches.update({ ...@@ -101,9 +102,10 @@ client.matches.update({
*/ */
Matches.prototype.update = function(obj) { Matches.prototype.update = function(obj) {
obj.path = '/' + this.options.get('subdomain') + obj.id + '/matches/' + obj.matchId; obj = this.convertCamelToUnderscoreProperties(obj);
obj.path = '/' + this.options.get('subdomain') + obj.id + '/matches/' + obj.match_id;
delete obj.id; delete obj.id;
delete obj.matchId; delete obj.match_id;
obj.method = 'PUT'; obj.method = 'PUT';
this.makeRequest(obj); this.makeRequest(obj);
}; };
...@@ -68,6 +68,19 @@ describe('matches endpoints', () => { ...@@ -68,6 +68,19 @@ describe('matches endpoints', () => {
matchId: 123 matchId: 123
}); });
}); });
it('should create an appropriate url with a underscore match_id', () => {
matchesInstance.makeRequest = (obj) => {
expect(obj).toEqual({
path: '/25/matches/123',
method: 'GET'
});
};
matchesInstance.show({
id: 25,
match_id: 123
});
});
}); });
// update PUT tournaments/:tournament/matches/:match_id // update PUT tournaments/:tournament/matches/:match_id
...@@ -98,5 +111,18 @@ describe('matches endpoints', () => { ...@@ -98,5 +111,18 @@ describe('matches endpoints', () => {
matchId: 123 matchId: 123
}); });
}); });
it('should create an appropriate url with an underscore match_id', () => {
matchesInstance.makeRequest = (obj) => {
expect(obj).toEqual({
path: '/25/matches/123',
method: 'PUT'
});
};
matchesInstance.update({
id: 25,
match_id: 123
});
});
}); });
}); });
...@@ -84,7 +84,7 @@ Participants.prototype.create = function(obj) { ...@@ -84,7 +84,7 @@ Participants.prototype.create = function(obj) {
* @memberof Participants * @memberof Participants
* @param {object} obj params to pass to the api request * @param {object} obj params to pass to the api request
* @param {string} obj.id The url of the tournament to get a participant in * @param {string} obj.id The url of the tournament to get a participant in
* @param {string} obj.participantId The id of the participant to get * @param {string} obj.participantId OR obj.participant_id The id of the participant to get
* @param {function} obj.callback A method to call when the API returns. Arguments are (error, data) * @param {function} obj.callback A method to call when the API returns. Arguments are (error, data)
* @description * @description
* Retrieve a single participant record for a tournament. * Retrieve a single participant record for a tournament.
...@@ -101,9 +101,10 @@ client.participants.show({ ...@@ -101,9 +101,10 @@ client.participants.show({
*/ */
Participants.prototype.show = function(obj) { Participants.prototype.show = function(obj) {
obj.path = '/' + this.options.get('subdomain') + obj.id + '/participants/' + obj.participantId; obj = this.convertCamelToUnderscoreProperties(obj);
obj.path = '/' + this.options.get('subdomain') + obj.id + '/participants/' + obj.participant_id;
delete obj.id; delete obj.id;
delete obj.participantId; delete obj.participant_id;
obj.method = 'GET'; obj.method = 'GET';
this.makeRequest(obj); this.makeRequest(obj);
}; };
...@@ -113,7 +114,7 @@ Participants.prototype.show = function(obj) { ...@@ -113,7 +114,7 @@ Participants.prototype.show = function(obj) {
* @memberof Participants * @memberof Participants
* @param {object} obj params to pass to the api request * @param {object} obj params to pass to the api request
* @param {string} obj.id The url of the tournament to update a participant in * @param {string} obj.id The url of the tournament to update a participant in
* @param {string} obj.participantId The id of the participant to update * @param {string} obj.participantId OR obj.participant_id The id of the participant to update
* @param {object} obj.participant The participant object with updates. See challonge docs for available properties. * @param {object} obj.participant The participant object with updates. See challonge docs for available properties.
* @param {function} obj.callback A method to call when the API returns. Arguments are (error, data) * @param {function} obj.callback A method to call when the API returns. Arguments are (error, data)
* @description * @description
...@@ -134,9 +135,10 @@ client.participants.update({ ...@@ -134,9 +135,10 @@ client.participants.update({
*/ */
Participants.prototype.update = function(obj) { Participants.prototype.update = function(obj) {
obj.path = '/' + this.options.get('subdomain') + obj.id + '/participants/' + obj.participantId; obj = this.convertCamelToUnderscoreProperties(obj);
obj.path = '/' + this.options.get('subdomain') + obj.id + '/participants/' + obj.participant_id;
delete obj.id; delete obj.id;
delete obj.participantId; delete obj.participant_id;
obj.method = 'PUT'; obj.method = 'PUT';
this.makeRequest(obj); this.makeRequest(obj);
}; };
...@@ -146,7 +148,7 @@ Participants.prototype.update = function(obj) { ...@@ -146,7 +148,7 @@ Participants.prototype.update = function(obj) {
* @memberof Participants * @memberof Participants
* @param {object} obj params to pass to the api request * @param {object} obj params to pass to the api request
* @param {string} obj.id The url of the tournament to remove a participant from * @param {string} obj.id The url of the tournament to remove a participant from
* @param {string} obj.participantId The id of the participant to remove * @param {string} obj.participantId OR obj.participant_id The id of the participant to remove
* @param {function} obj.callback A method to call when the API returns. Arguments are (error, data) * @param {function} obj.callback A method to call when the API returns. Arguments are (error, data)
* @description * @description
* If the tournament has not started, delete a participant, automatically filling in the abandoned seed number. If tournament is underway, mark a participant inactive, automatically forfeiting his/her remaining matches. * If the tournament has not started, delete a participant, automatically filling in the abandoned seed number. If tournament is underway, mark a participant inactive, automatically forfeiting his/her remaining matches.
...@@ -163,9 +165,10 @@ client.participants.destroy({ ...@@ -163,9 +165,10 @@ client.participants.destroy({
*/ */
Participants.prototype.destroy = function(obj) { Participants.prototype.destroy = function(obj) {
obj.path = '/' + this.options.get('subdomain') + obj.id + '/participants/' + obj.participantId; obj = this.convertCamelToUnderscoreProperties(obj);
obj.path = '/' + this.options.get('subdomain') + obj.id + '/participants/' + obj.participant_id;
delete obj.id; delete obj.id;
delete obj.participantId; delete obj.participant_id;
obj.method = 'DELETE'; obj.method = 'DELETE';
this.makeRequest(obj); this.makeRequest(obj);
}; };
......
...@@ -94,6 +94,19 @@ describe('participants endpoints', () => { ...@@ -94,6 +94,19 @@ describe('participants endpoints', () => {
participantId: 456 participantId: 456
}); });
}); });
it('should create an appropriate url with an underscore participant_id', () => {
participantsInstance.makeRequest = (obj) => {
expect(obj).toEqual({
path: '/25/participants/456',
method: 'GET'
});
};
participantsInstance.show({
id: 25,
participant_id: 456
});
});
}); });
// update PUT tournaments/:tournament/participants/:participant_id // update PUT tournaments/:tournament/participants/:participant_id
...@@ -123,6 +136,18 @@ describe('participants endpoints', () => { ...@@ -123,6 +136,18 @@ describe('participants endpoints', () => {
participantId: 456 participantId: 456
}); });
}); });
it('should create an appropriate url with an underscore participant_id', () => {
participantsInstance.makeRequest = (obj) => {
expect(obj).toEqual({
path: '/25/participants/456',
method: 'PUT'
});
};
participantsInstance.update({
id: 25,
participant_id: 456
});
});
}); });
// destroy DELETE tournaments/:tournament/participants/:participant_id // destroy DELETE tournaments/:tournament/participants/:participant_id
...@@ -152,6 +177,19 @@ describe('participants endpoints', () => { ...@@ -152,6 +177,19 @@ describe('participants endpoints', () => {
participantId: 456 participantId: 456
}); });
}); });
it('should create an appropriate url with an underscore participant_id', () => {
participantsInstance.makeRequest = (obj) => {
expect(obj).toEqual({
path: '/25/participants/456',
method: 'DELETE'
});
};
participantsInstance.destroy({
id: 25,
participant_id: 456
});
});
}); });
// randomize GET tournaments/:tournament/participants/randomize // randomize GET tournaments/:tournament/participants/randomize
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
"description": "Wrapper for the challong api", "description": "Wrapper for the challong api",
"author": "Aaron Tiwell <aaron.tidwell@gmail.com>", "author": "Aaron Tiwell <aaron.tidwell@gmail.com>",
"main": "./lib/challonge.js", "main": "./lib/challonge.js",
"version": "2.1.0", "version": "2.1.1",
"contributors": [ "contributors": [
{ {
"name": "Ricardo Reis", "name": "Ricardo Reis",
......
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