/backend

Primary LanguageJavaScriptMIT LicenseMIT

backend


POST create a user

[POST] https://potluckplanner-backend.herokuapp.com/api/auth/register

Name Type Description
username String

The New Users username *Required

password String

The New Users password *Required

organizer Boolean

Whether User is an Orangizer or not *Required

Returns the newly added User

POST login to account

[POST] https://potluckplanner-backend.herokuapp.com/api/auth/login

Name Type Description
username String

The New Users username *Required

password String

The New Users password *Required

returns the welcome message, user details and token {"message": "welcome, username", "userDeet": { "user_id": integer, "username": "string" }, "token": "token sequence here"}


GET - find all potlucks a user is registered for...

[GET] https://potluckplanner-backend.herokuapp.com/api/guest/:id

Name Type Description
user_id Integer

Guest's User_id *Required

returns an array of potlucks.


GET - all potlucks

[GET] https://potluckplanner-backend.herokuapp.com/api/potluck/

returns all potlucks

GET - Potluck by id

[GET] https://potluckplanner-backend.herokuapp.com/api/potluck/:id

Name Type Description
potluck_id Integer

Potluck's id *Required

returns potluck


GET - all Organizer's Potlucks

[GET] https://potluckplanner-backend.herokuapp.com/api/organizer/:id

Name Type Description
potluck_id Integer

Potluck's id *Required

returns all potlucks belonging to organizer

POST - create potluck event

[POST] https://potluckplanner-backend.herokuapp.com/api/organizer/potluck

Requires object with key:value pairs defined in table

Name Type Description
title String

The Title of the event *Required

date Date

The Date of the event (MM/DD/YYYY) *Required

time Time

The Time fo the event (HH:MM:SS) *Required

location String

The location of the event *Required

organizer_id Integer

The id of the organizer *Required

returns newly added event

DELETE - delete potluck

[DELETE] - https://potluckplanner-backend.herokuapp.com/api/organizer/potluck/:id

Name Type Description
potluck_id Integer

Potluck's id *Required

(param)

returns deleted event

PUT - update potluck

[PUT] - https://potluckplanner-backend.herokuapp.com/api/organizer/potluck/:id

Name Type Description
potluck_id Integer

Potluck's id *Required

(param)
potluck object

Object containing event details as defined above

returns updated event


POST - create potluck item

[POST] - https://potluckplanner-backend.herokuapp.com/api/item/potluck/:id ( :id = potluck id )

Name Type Description
potluck_id Integer

Potluck's id *Required

(param)
item string

Object containing event details as defined above

returns newly created item

GET - get potluck item by id

[GET] https://potluckplanner-backend.herokuapp.com/api/item/:id ( :id = item id )

Name Type Description
item_id Integer

item's id *Required

(param)

returns item

GET - get all potluck items

[GET] https://potluckplanner-backend.herokuapp.com/api/item/all/:id ( :id = potluck id )

Name Type Description
potluck_id Integer

Potluck's id *Required

(param)

returns array of all items for potluck

POST - user to claim item from potluck list

[POST] https://potluckplanner-backend.herokuapp.com/api/item/claim/:id ( :id = potluck id )

Name Type Description
potluck_id Integer

Potluck's id *Required

(param)
item_id Integer

Item's id *Required

returns array of items for specific potluck