TeamService
Source: TeamService.ts:3
Service for managing teams and their data.
Constructor
new TeamService(): TeamServiceInstance Methods
getAll(): Promise.<Array>
Get all teams.
Returns
Promise.<Array>— Array of team objects
getByName(name: string): Promise.<Array>
Get teams by name.
Parameters
name(string) — Name of the team to search for
Returns
Promise.<Array>— Array of team objects
getById(teamId: string): Promise.<Object>
Get a team by its ID.
Parameters
teamId(string) — ID of the team
Returns
Promise.<Object>— Team object
create(
name: string,
clubId: string,
seasonId: string,
ownerId: string | null,
): Promise.<Object>
Create a new team.
Parameters
name(string) — Name of the team to createclubId(string) — ID of the club the team belongs toseasonId(string) — ID of the season the team is inownerId(string | null, default: null) — ID of the owner
Returns
Promise.<Object>— Created team
setName(teamId: string, name: string): Promise.<Object>
Set the name of a team.
Parameters
teamId(string) — ID of the team to updatename(string) — New name for the team
Returns
Promise.<Object>— Updated team
remove(teamId: string): Promise.<Object>
Remove a team by its ID.
Parameters
teamId(string) — ID of the team to remove
Returns
Promise.<Object>— Response data