Methods
create(name, clubId, seasonId) → {Promise.<Object>}
Create a new team.
Parameters:
| Name | Type | Description |
|---|---|---|
name | string | Name of the team to create |
clubId | string | ID of the club the team belongs to |
seasonId | string | ID of the season the team is in |
- Source
Returns:
Created team
- Type:
- Promise.<Object>
getAll() → {Promise.<Array>}
Get all teams.
- Source
Returns:
Array of team objects
- Type:
- Promise.<Array>
getById(teamId) → {Promise.<Object>}
Get a team by its ID.
Parameters:
| Name | Type | Description |
|---|---|---|
teamId | string | ID of the team |
- Source
Returns:
Team object
- Type:
- Promise.<Object>
getByName(name) → {Promise.<Array>}
Get teams by name.
Parameters:
| Name | Type | Description |
|---|---|---|
name | string | Name of the team to search for |
- Source
Returns:
Array of team objects
- Type:
- Promise.<Array>
remove(teamId) → {Promise.<Object>}
Remove a team by its ID.
Parameters:
| Name | Type | Description |
|---|---|---|
teamId | string | ID of the team to remove |
- Source
Returns:
Response data
- Type:
- Promise.<Object>
setName(teamId, name) → {Promise.<Object>}
Set the name of a team.
Parameters:
| Name | Type | Description |
|---|---|---|
teamId | string | ID of the team to update |
name | string | New name for the team |
- Source
Returns:
Updated team
- Type:
- Promise.<Object>