Races

/race

GET /list/:page?/:length? +

Get a paginated list of Races… sorted such that recent races are first

Parameters:

page: Page number to grab
length: How many races per page

Returns: [Race]

GET /list +

Get all Races in the database… this is a LOT of data so be sure you want this route

Returns: [Race]

GET /:id +

Get a single race by its ID

Parameters:

id: _id of Race

Returns: Race

GET /:id/:gender/events +

Get a list of events for a Race and gender

Parameters:

id: _id of Race
gender: "mens" or "womens" // defaults to womens if it doesn't match either string

Returns: [String]

GET /vote/:id -

Get your vote data for a race

Parameters:

id: _id of Race

Returns: Vote

POST / -

Create a Race

Expects: Race (accepts partial Race)

Returns: Race

POST /upvote/:id -

Upvote a race

Parameters:

id: _id of race

Returns: Race

POST /downvote/:id -

Downvote a race

Parameters:

id: _id of race

Returns: Race

PUT / -

Update a Race

Expects: Race (accepts partial Race)

Returns: Race

DELETE /:id -

Delete a Race

Parameters:

id: _id of Race

Returns: "Successfully deleted race"