From 0568e92c65bb3ebfc6da7641c2dab8ce135eed99 Mon Sep 17 00:00:00 2001 From: PieLord757 Date: Sat, 14 Sep 2024 21:40:22 -0400 Subject: [PATCH 1/3] Added The two button groups and dietary restrictions --- html/Form.html | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/html/Form.html b/html/Form.html index 93e577b..6fbce20 100644 --- a/html/Form.html +++ b/html/Form.html @@ -47,6 +47,25 @@ +
+
+
+
+

Select Dietary Restriction

+
+
+
+
+
+
+
+
+
+
+
+
+
+
From 37e1b1013143285a443b97fa90efcf0253855fd0 Mon Sep 17 00:00:00 2001 From: Auth <93170896+AuthGithub@users.noreply.github.com> Date: Sat, 14 Sep 2024 22:09:28 -0400 Subject: [PATCH 2/3] one random space for some reason --- server/ai.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/server/ai.js b/server/ai.js index 9fd6872..5352db9 100644 --- a/server/ai.js +++ b/server/ai.js @@ -82,8 +82,7 @@ class aiClass{ model: 'llama3:latest', messages: [{ role: 'user', content: `Give one food suggestion this question answers. - - + ` }], }); From 0aca077f6e12438b45b1a478885c4e3645fc6f2e Mon Sep 17 00:00:00 2001 From: PieLord757 Date: Sat, 14 Sep 2024 22:11:20 -0400 Subject: [PATCH 3/3] Pretty much cloned users.js in the api folder and made it recipes.js --- server/api/recipes.js | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 server/api/recipes.js diff --git a/server/api/recipes.js b/server/api/recipes.js new file mode 100644 index 0000000..6e50d71 --- /dev/null +++ b/server/api/recipes.js @@ -0,0 +1,35 @@ +import APIRoute from "../APIRoute.js"; + +export default class UsersAPI extends APIRoute { + constructor() { + super('/recipes'); + + this.addSubRoute('/create', 'post', createRecipe); + } + + async get(req, res) { + res.send('GET request'); + } + + async post(req, res) { + res.send('POST request'); + } + + async createRecipe(req, res) { + let recipe = req.body; + + let db = req.app.get('mongo').recipes; + + let result = await db.create({ + userID: recipe.userID, + ingredients: recipe.ingredients, + productName: recipe.productName, + nutritionFacts: recipe.nutritionFacts, + rating: recipe.rating, + cuisine: recipe.cuisine, + expense: recipe.expense, + mealType: recipe.mealType + }); + + } +} \ No newline at end of file