@@ -50,28 +50,26 @@ app.get("/email", async (req, res) => {
5050
5151
5252app . get ( "/openai" , async ( req , res ) => {
53- console . log ( req . query ) ;
53+
54+ const { recipe_country_of_origin, is_lactose_intolerant, is_vegan, what_are_user_other_dietary_requirements } = req . query
5455 try {
5556 console . log (
56- { country : req . query . recipe_country_of_origin } ,
57- { lactose_intolerant : req . query . is_lactose_intolerant } ,
58- { is_vegan : req . query . is_vegan } ,
59- {
60- user_otherdietary_requirements :
61- req . query . what_are_user_other_dietary_requirements ,
62- }
57+ { recipe_country_of_origin } ,
58+ { is_lactose_intolerant } ,
59+ { is_vegan } ,
60+ { what_are_user_other_dietary_requirements}
6361 ) ;
6462
6563 const prompt = `Provide a recipe for a dish from ${
66- req . query . recipe_country_of_origin
64+ recipe_country_of_origin
6765 } , taking into account the fact that I'm ${
68- req . query . is_lactose_intolerant === "true"
66+ is_lactose_intolerant === "true"
6967 ? "lactose intolerant"
7068 : "not lactose intolerant"
71- } ${ req . query . is_vegan === "true" ? "vegan" : "not vegan" } and ${
72- req . query . what_are_user_other_dietary_requirements === ""
69+ } ${ is_vegan === "true" ? "vegan" : "not vegan" } and ${
70+ what_are_user_other_dietary_requirements === ""
7371 ? "I have no other dietary requirements"
74- : req . query . what_are_user_other_dietary_requirements
72+ : what_are_user_other_dietary_requirements
7573 } `;
7674
7775 console . log ( prompt ) ;
0 commit comments