prep/cook times and some fit and finish
This commit is contained in:
parent
a3b0fffe45
commit
9656888cb7
14 changed files with 141 additions and 46 deletions
|
@ -49,7 +49,7 @@ app.get("/backend/recipe/:id", async (req, res) => {
|
|||
try {
|
||||
const recipeQuery = db("recipes")
|
||||
.where("id", "=", id)
|
||||
.select("id", "name", "author", "cuisine", "stars");
|
||||
.select("id", "name", "author", "cuisine", "stars", "prep_minutes", "cook_minutes");
|
||||
|
||||
const ingredientsQuery = db
|
||||
.from("recipe_ingredients")
|
||||
|
@ -81,13 +81,15 @@ app.get("/backend/recipe/:id", async (req, res) => {
|
|||
|
||||
// ### ADD RECIPE ###
|
||||
app.post("/backend/add-recipe", async (req, res) => {
|
||||
const { name, author, cuisine, stars, ingredients, steps } = req.body;
|
||||
const { name, author, cuisine, stars, ingredients, steps, prep_minutes, cook_minutes } = req.body;
|
||||
try {
|
||||
const [id] = await db("recipes").insert(
|
||||
{
|
||||
name: name,
|
||||
author: author,
|
||||
cuisine: cuisine,
|
||||
prep_minutes: prep_minutes,
|
||||
cook_minutes: cook_minutes,
|
||||
stars: stars,
|
||||
},
|
||||
["id"],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue