ClubService

new ClubService()

Service for managing clubs and their data.

Methods

create(name) → {Promise.<Object>}

Create a new club.

Parameters:
NameTypeDescription
namestring

Name of the club to create

Returns:

Created club

Type: 
Promise.<Object>

Delete a club's logo.

Parameters:
NameTypeDescription
clubIdstring

ID of the club

Returns:

Response data

Type: 
Promise.<Object>

findByName(name) → {Promise.<Array>}

Find clubs by name.

Parameters:
NameTypeDescription
namestring

Name of the club to search for

Returns:

Array of club objects

Type: 
Promise.<Array>

getAll() → {Promise.<Array>}

Get all clubs.

Returns:

Array of club objects

Type: 
Promise.<Array>

getById(clubId) → {Promise.<Object>}

Get a club by its ID.

Parameters:
NameTypeDescription
clubIdstring

ID of the club

Returns:

Club object

Type: 
Promise.<Object>

Get a club's logo as a blob.

Parameters:
NameTypeDescription
clubIdstring

ID of the club

Returns:

Club logo blob

Type: 
Promise.<Blob>

remove(clubId) → {Promise.<Object>}

Remove a club by its ID.

Parameters:
NameTypeDescription
clubIdstring

ID of the club to remove

Returns:

Response data

Type: 
Promise.<Object>

update(clubId, data) → {Promise.<Object>}

Update a club's data.

Parameters:
NameTypeDescription
clubIdstring

ID of the club to update

dataObject

Data to update the club with

Returns:

Updated club

Type: 
Promise.<Object>

Update a club's logo.

Parameters:
NameTypeDescription
clubIdstring

ID of the club to update

clubLogoFile

Logo file to upload

Returns:

Response data

Type: 
Promise.<Object>