Skip to content

[feat] Duplicate plants warning + delete plants functionality #116

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

torinnayak1
Copy link
Collaborator

What's new in this PR 🧑‍🌾

Description

When attempting to add plants that are already in their garden, shows a popup that there are plants to be added that are already in the garden (naming the plants), giving the user the option to proceed and add the plants again or press no and edit their details. Also added a delete button next to the plants in the review page of the add details

Screenshots

image

Screenshot 2025-04-17 at 6 08 00 PM

How to review

I think there are probably more efficient ways to write some of the backend functions, please let me know. Edge cases could be when having a mixture of duplicates and non duplicates and then removing some and trying again (works on my end but I doubt I tested everything).

Next steps

Maybe consolidating same plants with different seasons into the same card? Also, should they be redirected to plants page if they remove all plants from the add details?

Relevant links

Online sources

Related PRs

CC: @kylezryr

Copy link
Collaborator

@kylezryr kylezryr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

works pretty well! just a bug with deleting a plant and then going back to the details page and its still there, resulting in an error. also to add a check to route the user to view plants if the details list is empty. good job overall!

);

// Remove any undefined values (in case a lookup failed)
setDuplicates(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we do this filtering to remove undefined values in the insertUserPlants function?

@kylezryr kylezryr linked an issue Apr 22, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add warning to add details for adding duplicate plants
2 participants