ClubService

Source: ClubService.ts:3

Service for managing clubs and their data.


Constructor

new ClubService(): ClubService

Instance Methods

getAll(): Promise.<Array>

Get all clubs.

Returns

  • Promise.<Array> — Array of club objects

getById(clubId: string): Promise.<Object>

Get a club by its ID.

Parameters

  • clubId (string) — ID of the club

Returns

  • Promise.<Object> — Club object

findByName(name: string): Promise.<Array>

Find clubs by name.

Parameters

  • name (string) — Name of the club to search for

Returns

  • Promise.<Array> — Array of club objects

create(name: string, ownerId: string | null): Promise.<Object>

Create a new club.

Parameters

  • name (string) — Name of the club to create
  • ownerId (string | null, default: null) — ID of the owner

Returns

  • Promise.<Object> — Created club

update(clubId: string, data: Object): Promise.<Object>

Update a club's data.

Parameters

  • clubId (string) — ID of the club to update
  • data (Object) — Data to update the club with

Returns

  • Promise.<Object> — Updated club

Update a club's logo.

Parameters

  • clubId (string) — ID of the club to update
  • clubLogo (File) — Logo file to upload

Returns

  • Promise.<Object> — Response data

Get a club's logo as a blob.

Parameters

  • clubId (string) — ID of the club

Returns

  • Promise.<Blob> — Club logo blob

Delete a club's logo.

Parameters

  • clubId (string) — ID of the club

Returns

  • Promise.<Object> — Response data

remove(clubId: string): Promise.<Object>

Remove a club by its ID.

Parameters

  • clubId (string) — ID of the club to remove

Returns

  • Promise.<Object> — Response data