Skip to content

Latest commit

 

History

History
394 lines (280 loc) · 11.7 KB

documentation.md

File metadata and controls

394 lines (280 loc) · 11.7 KB

Functions

saveUser(name, token, facebookId, boolean)

saveUser

getArtists(city)

getArtist gets Artists specifically from the inputted city

getTracks(artist)

getTracks gets all the tracks from the artist

checkArtistTable(name)

checkArtistTable checks the Artist table in the database whether the name exists

checkUsersTable(facebookID)

checkUsersTable checks Users table in the database using his or her Facebook ID

getChatrooms(userId)

getChatrooms gets all the messages between a specific user and their recipient from the Requested_Gigs table

getCurrentUser(facebookId)

getCurrentUser gets the specified user from the Users table using their Facebook ID

setFacebookId(facebookId)

setFacebookId - sets the Facebook ID state of current user that is logged in

setCurrentUser(currentUser)

setCurrentUser sets state of current user that is logged in

searchClickHandler(input)

searchClickHandler handles different inputs of cities

onChange(input)

onChange handles change of text inside search bar

setArtist(artist)

setArtist sets artist and tracks states of artist that was selected on the page using a POST request

setTracks(tracks)

setTracks sets state of tracks

onEnter(e)null

onEnter enable enter key to trigger this.props.onClick which is a search handler function

responseFacebook(response)null

responseFacebook

handleOpenModal()

handleOpenModal changes the showModal state to true to render the popup

handleCloseModal()

handleCloseModal changes the showModal state to false to hide the popup

onClickHandler(input)

onClickHandler make post request to sent he message to the artist.

seed(knex, Promise)Promise

seed This function is created with creating a seed with knex and is used to add starterdata into tables

createSFArtist(knex, artist)Promise
createLAArtist(knex, artist)Promise
createNYArtist(knex, artist)Promise
createDate(knex, day)Promise
createSingle(knex, artist, id)Promise
createUser(knex, artist)Promise
up(knex, Promise)Promise

up This will generate all the tables in the database

down(knex, Promise)Promise

saveUser(name, token, facebookId, boolean)

saveUser

Kind: global function

Param Type Description
name string name of user
token string token generated by Facebook when user logs in
facebookId string user's Facebook ID
boolean boolean true if artist, false if user

getArtists(city)

getArtist gets Artists specifically from the inputted city

Kind: global function

Param Type Description
city string city inputted by user

getTracks(artist)

getTracks gets all the tracks from the artist

Kind: global function

Param Type Description
artist string name of artist

checkArtistTable(name)

checkArtistTable checks the Artist table in the database whether the name exists

Kind: global function

Param Type Description
name string name of user that is passed in

checkUsersTable(facebookID)

checkUsersTable checks Users table in the database using his or her Facebook ID

Kind: global function

Param Type Description
facebookID string Facebook ID of user that is passed in

getChatrooms(userId)

getChatrooms gets all the messages between a specific user and their recipient from the Requested_Gigs table

Kind: global function

Param Type Description
userId integer ID of the specified user that is fetched from the users table in the database

getCurrentUser(facebookId)

getCurrentUser gets the specified user from the Users table using their Facebook ID

Kind: global function

Param Type Description
facebookId string the user's facebookId

up(knex, Promise) ⇒ Promise

up This will generate all the tables in the database

Kind: global function

Param Type Description
knex Promise Helps execute SQL queries to create the tables
Promise Promise Ensures that all tables will be created

down(knex, Promise) ⇒ Promise

Kind: global function Returns: Promise - Will drop all the tables if you need to rollback a migration

Param Type Description
knex Promise Helps execute SQL queries
Promise Promise Was not needed

seed(knex, Promise) ⇒ Promise

seed This function is created with creating a seed with knex and is used to add starterdata into tables

Kind: global function Returns: Promise - This will populate the tables with initial data from artists

Param Type Description
knex Promise SQL builder
Promise Promise This is a promise that will ensure that the tables will be populated

createSFArtist(knex, artist) ⇒ Promise

Kind: global function Returns: Promise - Inserts an entry into the artist table for SF artists

Param Type Description
knex Promise SQL builder
artist Object This object contains the artist's name, city, image, and uri

createLAArtist(knex, artist) ⇒ Promise

Kind: global function Returns: Promise - Inserts an entry into the artist table for LA artists

Param Type Description
knex Promise SQL builder
artist Object This object contains the artist's name, city, image, and uri

createNYArtist(knex, artist) ⇒ Promise

Kind: global function Returns: Promise - Inserts an entry into the artist table for NY artists

Param Type Description
knex Promise SQL builder
artist Object This object contains the artist's name, city, image, and uri

createDate(knex, day) ⇒ Promise

Kind: global function Returns: Promise - Inserts a date entry into the date table

Param Type Description
knex Promise SQL builder
day String This will be in the format of 'D/M' for all 365 days of the year

createSingle(knex, artist, id) ⇒ Promise

Kind: global function Returns: Promise - Inserts an entry containing an artist's single and name into the single table

Param Type Description
knex Promise SQL builder
artist String
id Number

createUser(knex, artist) ⇒ Promise

Kind: global function Returns: Promise - Inserts a user into the users table

Param Type Description
knex Promise SQL builder
artist Object

setFacebookId(facebookId)

setFacebookId - sets the Facebook ID state of current user that is logged in

Kind: global function

Param Type Description
facebookId string The Facebook ID that is returned from the database

setCurrentUser(currentUser)

setCurrentUser sets state of current user that is logged in

Kind: global function

Param Type Description
currentUser string the current user that is returned

searchClickHandler(input)

searchClickHandler handles different inputs of cities

Kind: global function

Param Type Description
input string name of city that is typed in by the user

onChange(input)

onChange handles change of text inside search bar

Kind: global function

Param Type Description
input string input from user into searchbar

setArtist(artist)

setArtist sets artist and tracks states of artist that was selected on the page using a POST request

Kind: global function

Param Type Description
artist string artist that is selected by user

setTracks(tracks)

setTracks sets state of tracks

Kind: global function

Param Type Description
tracks array array of tracks returned from database

onEnter(e) ⇒ null

onEnter enable enter key to trigger this.props.onClick which is a search handler function

Kind: global function

Param Type Description
e object event object from key press on enter

responseFacebook(response) ⇒ null

responseFacebook

Kind: global function

Param Type
response object

handleOpenModal() ⇒

handleOpenModal changes the showModal state to true to render the popup

Kind: global function

handleCloseModal() ⇒

handleCloseModal changes the showModal state to false to hide the popup

Kind: global function

onClickHandler(input) ⇒

onClickHandler make post request to sent he message to the artist.

Kind: global function

Param Type Description
input string message to be sent to artist from current user.