# Class: Teams

## Teams()

Teams Controller ------------------------------------------------------------- This controller contains logic related to viewing and managing the user's team, team lineups, and team players.

## Constructor

#### new Teams()

Source:
  - app/controllers/Teams.controller.js, line 11

### Extends

- Controller

### Methods

#### (async) create_team(req, res) → {Promise.<*>}

API endpoint for creating a new team.

##### Parameters:

Name | Type | Description
--- | --- | ---
`req` |  |
`res` |  |

Source:
  - app/controllers/Teams.controller.js, line 150
To Do:
  - remove this - happens automatically per-user

##### Returns:

Type
  Promise.<*>

#### (async) get_my_team(req, res, next) → {Promise.<void>}

Return the API data for the current user's team. Requires an authenticated user.

##### Parameters:

Name | Type | Description
--- | --- | ---
`req` |  |
`res` |  |
`next` |  |

Source:
  - app/controllers/Teams.controller.js, line 37

##### Returns:

Type
  Promise.<void>

#### (async) get_my_team_current_lineup(req, res, next) → {Promise.<*>}

Return the API data for the current lineup for the current user's team.

##### Parameters:

Name | Type | Description
--- | --- | ---
`req` |  |
`res` |  |
`next` |  |

Source:
  - app/controllers/Teams.controller.js, line 60

##### Returns:

Type
  Promise.<*>

#### (async) get_my_team_players(req, res, next) → {Promise.<*>}

Return the API data for the players on the current user's team.

##### Parameters:

Name | Type | Description
--- | --- | ---
`req` |  |
`res` |  |
`next` |  |

Source:
  - app/controllers/Teams.controller.js, line 48

##### Returns:

Type
  Promise.<*>

#### (async) list_all_teams(req, res) → {Promise.<*>}

Return the API data for a list of all teams.

##### Parameters:

Name | Type | Description
--- | --- | ---
`req` |  |
`res` |  |

Source:
  - app/controllers/Teams.controller.js, line 137

##### Returns:

Type
  Promise.<*>

#### (async) save_my_team(req, res, next) → {Promise.<*>}

Save changes to the current user's team and return it as API data.

##### Parameters:

Name | Type | Description
--- | --- | ---
`req` |  |
`res` |  |
`next` |  |

Source:
  - app/controllers/Teams.controller.js, line 23

##### Returns:

Type
  Promise.<*>

#### (async) save_my_team_lineup(req, res, next) → {Promise.<void>}

Saves the lineup for the current user's team and returns it as API data.

##### Parameters:

Name | Type | Description
--- | --- | ---
`req` |  |
`res` |  |
`next` |  |

Source:
  - app/controllers/Teams.controller.js, line 72

##### Returns:

Type
  Promise.<void>