<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JSDoc: Class: Teams</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: Teams</h1> <section> <header> <h2><span class="attribs"><span class="type-signature"></span></span>Teams<span class="signature">()</span><span class="type-signature"></span></h2> <div class="class-description">Teams Controller ------------------------------------------------------------- This controller contains logic related to viewing and managing the user's team, team lineups, and team players.</div> </header> <article> <div class="container-overview"> <h2>Constructor</h2> <h4 class="name" id="Teams"><span class="type-signature"></span>new Teams<span class="signature">()</span><span class="type-signature"></span></h4> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="app_controllers_Teams.controller.js.html">app/controllers/Teams.controller.js</a>, <a href="app_controllers_Teams.controller.js.html#line11">line 11</a> </li></ul></dd> </dl> </div> <h3 class="subsection-title">Extends</h3> <ul> <li>Controller</li> </ul> <h3 class="subsection-title">Methods</h3> <h4 class="name" id="create_team"><span class="type-signature">(async) </span>create_team<span class="signature">(req, res)</span><span class="type-signature"> → {Promise.<*>}</span></h4> <div class="description"> API endpoint for creating a new team. </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>req</code></td> <td class="type"> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>res</code></td> <td class="type"> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="app_controllers_Teams.controller.js.html">app/controllers/Teams.controller.js</a>, <a href="app_controllers_Teams.controller.js.html#line150">line 150</a> </li></ul></dd> <dt class="tag-todo">To Do:</dt> <dd class="tag-todo"> <ul> <li>remove this - happens automatically per-user</li> </ul> </dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">Promise.<*></span> </dd> </dl> <h4 class="name" id="get_my_team"><span class="type-signature">(async) </span>get_my_team<span class="signature">(req, res, next)</span><span class="type-signature"> → {Promise.<void>}</span></h4> <div class="description"> Return the API data for the current user's team. Requires an authenticated user. </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>req</code></td> <td class="type"> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>res</code></td> <td class="type"> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>next</code></td> <td class="type"> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="app_controllers_Teams.controller.js.html">app/controllers/Teams.controller.js</a>, <a href="app_controllers_Teams.controller.js.html#line37">line 37</a> </li></ul></dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">Promise.<void></span> </dd> </dl> <h4 class="name" id="get_my_team_current_lineup"><span class="type-signature">(async) </span>get_my_team_current_lineup<span class="signature">(req, res, next)</span><span class="type-signature"> → {Promise.<*>}</span></h4> <div class="description"> Return the API data for the current lineup for the current user's team. </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>req</code></td> <td class="type"> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>res</code></td> <td class="type"> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>next</code></td> <td class="type"> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="app_controllers_Teams.controller.js.html">app/controllers/Teams.controller.js</a>, <a href="app_controllers_Teams.controller.js.html#line60">line 60</a> </li></ul></dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">Promise.<*></span> </dd> </dl> <h4 class="name" id="get_my_team_players"><span class="type-signature">(async) </span>get_my_team_players<span class="signature">(req, res, next)</span><span class="type-signature"> → {Promise.<*>}</span></h4> <div class="description"> Return the API data for the players on the current user's team. </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>req</code></td> <td class="type"> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>res</code></td> <td class="type"> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>next</code></td> <td class="type"> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="app_controllers_Teams.controller.js.html">app/controllers/Teams.controller.js</a>, <a href="app_controllers_Teams.controller.js.html#line48">line 48</a> </li></ul></dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">Promise.<*></span> </dd> </dl> <h4 class="name" id="list_all_teams"><span class="type-signature">(async) </span>list_all_teams<span class="signature">(req, res)</span><span class="type-signature"> → {Promise.<*>}</span></h4> <div class="description"> Return the API data for a list of all teams. </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>req</code></td> <td class="type"> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>res</code></td> <td class="type"> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="app_controllers_Teams.controller.js.html">app/controllers/Teams.controller.js</a>, <a href="app_controllers_Teams.controller.js.html#line137">line 137</a> </li></ul></dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">Promise.<*></span> </dd> </dl> <h4 class="name" id="save_my_team"><span class="type-signature">(async) </span>save_my_team<span class="signature">(req, res, next)</span><span class="type-signature"> → {Promise.<*>}</span></h4> <div class="description"> Save changes to the current user's team and return it as API data. </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>req</code></td> <td class="type"> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>res</code></td> <td class="type"> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>next</code></td> <td class="type"> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="app_controllers_Teams.controller.js.html">app/controllers/Teams.controller.js</a>, <a href="app_controllers_Teams.controller.js.html#line23">line 23</a> </li></ul></dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">Promise.<*></span> </dd> </dl> <h4 class="name" id="save_my_team_lineup"><span class="type-signature">(async) </span>save_my_team_lineup<span class="signature">(req, res, next)</span><span class="type-signature"> → {Promise.<void>}</span></h4> <div class="description"> Saves the lineup for the current user's team and returns it as API data. </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>req</code></td> <td class="type"> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>res</code></td> <td class="type"> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>next</code></td> <td class="type"> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="app_controllers_Teams.controller.js.html">app/controllers/Teams.controller.js</a>, <a href="app_controllers_Teams.controller.js.html#line72">line 72</a> </li></ul></dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">Promise.<void></span> </dd> </dl> </article> </section> </div> <nav> <h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-fake_data.html">fake_data</a></li><li><a href="module-routing.html">routing</a></li><li><a href="module-util.html">util</a></li></ul><h3>Classes</h3><ul><li><a href="ActiveScope.html">ActiveScope</a></li><li><a href="AddPlayersComponent.html">AddPlayersComponent</a></li><li><a href="DraftBoard.html">DraftBoard</a></li><li><a href="DraftBoardComponent.html">DraftBoardComponent</a></li><li><a href="FrontendUnit.html">FrontendUnit</a></li><li><a href="GenerateMatchupsForWeekPatch.html">GenerateMatchupsForWeekPatch</a></li><li><a href="GenerateWeeklyResultsPatch.html">GenerateWeeklyResultsPatch</a></li><li><a href="GridActionButtonComponent.html">GridActionButtonComponent</a></li><li><a href="GridComponent.html">GridComponent</a></li><li><a href="Home.html">Home</a></li><li><a href="InjectUserTeam.html">InjectUserTeam</a></li><li><a href="LeagueComponent.html">LeagueComponent</a></li><li><a href="Lineup.html">Lineup</a></li><li><a href="LinkComponent.html">LinkComponent</a></li><li><a href="Matchup.html">Matchup</a></li><li><a href="module-routing-Router.html">Router</a></li><li><a href="MyTeamComponent.html">MyTeamComponent</a></li><li><a href="Player.html">Player</a></li><li><a href="ScoresComponent.html">ScoresComponent</a></li><li><a href="ScoresController.html">ScoresController</a></li><li><a href="SeedAPIDataPatch.html">SeedAPIDataPatch</a></li><li><a href="SeedWeeklyPlayerDataPatch.html">SeedWeeklyPlayerDataPatch</a></li><li><a href="SportsDataService.html">SportsDataService</a></li><li><a href="Team.html">Team</a></li><li><a href="Teams.html">Teams</a></li><li><a href="TopLevelComponent.html">TopLevelComponent</a></li><li><a href="User.html">User</a></li><li><a href="WeeklyPlayerStat.html">WeeklyPlayerStat</a></li><li><a href="WeeklyTeamStat.html">WeeklyTeamStat</a></li></ul><h3>Global</h3><ul><li><a href="global.html#GridCellRenderType">GridCellRenderType</a></li></ul> </nav> <br class="clear"> <footer> Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.5</a> on Sun Nov 08 2020 14:34:32 GMT-0600 (Central Standard Time) </footer> <script> prettyPrint(); </script> <script src="scripts/linenumber.js"> </script> </body> </html>