Members
(constant) add
Companion file as to example.test.js
- Source:
Methods
add_favorite(recipeName)
Getting the name of the user's favorited recipe
Parameters:
| Name | Type | Description |
|---|---|---|
recipeName |
* | Name (not hashkey) of the favorite recipe being added to the DB |
- Source:
add_user_recipe(recipeName, servings, cookTime, instructions, dietRestrictions, ingredients)
Adds recipes that the user has made. Only contains relevant information.
Parameters:
| Name | Type | Description |
|---|---|---|
recipeName |
* | Name of the recipe being saved |
servings |
* | Serving size of the recipe |
cookTime |
* | Cook time of the recipe |
instructions |
* | List of strings that make up the instrcutions |
dietRestrictions |
* | List of booleans for the user recipes |
ingredients |
* | List of ingredients for the user recipes |
- Source:
bindCheckboxes()
bind displayCards function to the event of toggling checkboxes
bindSearchBar()
event listeners on search input change
bindSearchButton()
event listeners on search button click
clearDropdowns()
wipe dropdowns
configureRecipeCards()
add event listeners for each recipe card onclick
defaultPreference()
apply the default preferences to the UI
delete_favorite_recipe(recipeName)
Deletes the recipe matching the name in the database under their favorites
Parameters:
| Name | Type | Description |
|---|---|---|
recipeName |
* |
- Source:
delete_user_recipe(recipeHash)
Deletes the recipe matching the hash in the database under the user created recipes
Parameters:
| Name | Type | Description |
|---|---|---|
recipeHash |
* |
- Source:
displayCards()
displays the current recipes with filters applied
edit_recipe(recipeName, recipe)
Edits the recipe matching the name in the database under the user created recipe
Parameters:
| Name | Type | Description |
|---|---|---|
recipeName |
* | Name of the recipe to edit |
recipe |
* | Recipe object to extract data |
- Source:
get_favorites()
Fetch the user's favorite recipes
- Source:
Returns:
A list object of favorite recipes
get_user_recipes()
Get list of the user's created recipes
- Source:
Returns:
A list of user's past created recipes
hitSearch()
app logic when we hit search
readPreference() → {Array.<string>}
read the check boxes to return a list of preferences
Returns:
an array of preferences
- Type
- Array.<string>
registerCheckboxes()
this register listeners to toggle the savebutton whenever checkboxes are changed