Class: ClubAPI

ClubAPI()

This class contains all the database functions for the clubs

Constructor

new ClubAPI()

Source:

Methods

(async) addClub(club) → {Object}

Creates a club in the database with the given details.

Parameters:
Name Type Description
club Object

input club

Source:
To Do:
  • Remove unnecessary comments if not needed
Returns:

created club

Type
Object

(async) deleteClub(id) → {Object}

deletes the club from the database with the given id. And also removes the club entry from the clubAccess array of each user

Parameters:
Name Type Description
id String

input club id

Source:
Throws:

will throw an error if the club is not found

Returns:

A success response

Type
Object

resolveClubEvents(eventArray) → {Array}

Returns an array of resolved club events

Parameters:
Name Type Description
eventArray Array

array of event ids to be resolved

Source:
Returns:

array of resolved event objects

Type
Array

(async) updateClub(args) → {Object}

updates the club in the database with the given details.

Parameters:
Name Type Description
args Object

input club

Source:
Throws:

will throw an error if the club is not found

Returns:

created club

Type
Object