diff --git a/backend/backendServer.js b/backend/backendServer.js index d6ebc7e..c562dbb 100644 --- a/backend/backendServer.js +++ b/backend/backendServer.js @@ -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"], diff --git a/backend/migrations/20250728174922_add_times_recipes.js b/backend/migrations/20250728174922_add_times_recipes.js new file mode 100644 index 0000000..6ae9390 --- /dev/null +++ b/backend/migrations/20250728174922_add_times_recipes.js @@ -0,0 +1,22 @@ +/** + * @param { import("knex").Knex } knex + * @returns { Promise } + */ +exports.up = function (knex) { + + return knex.schema.table('recipes', table => { + table.integer('prep_minutes'); + table.integer('cook_minutes'); + }) +}; + +/** + * @param { import("knex").Knex } knex + * @returns { Promise } + */ +exports.down = function (knex) { + return knex.schema.table('recipes', table => { + table.dropColumn('prep_minutes'); + table.dropColumn('cook_minutes') + }) +}; diff --git a/frontend/index.html b/frontend/index.html index 40c9cfc..36fda5f 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -2,9 +2,9 @@ - + - Dev Recipe App + Recipe App
diff --git a/frontend/public/icon.svg b/frontend/public/icon.svg new file mode 100644 index 0000000..72fc9f1 --- /dev/null +++ b/frontend/public/icon.svg @@ -0,0 +1 @@ + diff --git a/frontend/public/vite.svg b/frontend/public/vite.svg deleted file mode 100644 index e7b8dfb..0000000 --- a/frontend/public/vite.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/frontend/src/App.css b/frontend/src/App.css index 3dfd428..7a2ce27 100644 --- a/frontend/src/App.css +++ b/frontend/src/App.css @@ -3,7 +3,7 @@ @tailwind utilities; #root { - @apply mx-auto text-center max-w-screen-lg; + @apply mx-auto text-center max-w-screen-lg w-full; } .page-outer { diff --git a/frontend/src/components/AddBulkIngredients.tsx b/frontend/src/components/AddBulkIngredients.tsx index 49968bb..ee6bc26 100644 --- a/frontend/src/components/AddBulkIngredients.tsx +++ b/frontend/src/components/AddBulkIngredients.tsx @@ -35,7 +35,7 @@ const AddBulkIngredients: React.FC = ({ ingredients, on return (
-

Please enter ingredients: Quantity, Unit, Name

+

Please enter each ingredient on a new line: