rjwignar / AIChefBot

Your AI-Powered Recipe Generator
https://ai-chef-bot.vercel.app
3 stars 0 forks source link

Stop obscuring deleted recipes in Generate Similar RecipeCardList #206

Open rjwignar opened 6 months ago

rjwignar commented 6 months ago

This fixes #205

This is the default onDelete prop passed to Recipe Cards when a RecipeCardList renders recipe cards:

https://github.com/rjwignar/AIChefBot/blob/ada5eb90e860445fb4edb781eed40c06d6130ec2/components/RecipeCardList.js#L28-L36

https://github.com/rjwignar/AIChefBot/blob/b8e28eebeec25a1e1dad3adc22b5f4229344ef98/components/RecipeCardList.js#L54-L60

onHandleDelete() obscures deleted recipes from the RecipeCardList, so the onDelete prop is only used when on the /account/recipes.js:

https://github.com/rjwignar/AIChefBot/blob/b8e28eebeec25a1e1dad3adc22b5f4229344ef98/components/RecipeCard.js#L110-L116

This is useful when a user deletes recipes from their Saved Recipes list. However, recipes.js renders a second RecipeCardList because it also hosts the Generate Similar Recipes use case:

We don't want this RecipeCardList to pass handleOneDelete() to its RecipeCards.

Changes

vercel[bot] commented 6 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
ai-chef-bot ✅ Ready (Inspect) Visit Preview Apr 15, 2024 9:14pm
ai-chef-bot-2 ✅ Ready (Inspect) Visit Preview Apr 15, 2024 9:14pm
kpunno commented 6 months ago

I don't know what I'm looking at but I'm glad it fixes things.

kpunno commented 6 months ago

@rjwignar

Can you elaborate on this? Or perhaps demonstrate this to me? Thanks.

rjwignar commented 6 months ago

Can you elaborate on this? Or perhaps demonstrate this to me? Thanks.

I can try to break it down, but I can also give a demonstration this afternoon:

Bug Explanation

Bug Fix: