StephMode / plant-pal

https://plant-pal-sigma.vercel.app
0 stars 0 forks source link

#6 update plant ✅ #6

Open StephMode opened 1 week ago

StephMode commented 1 week ago

Update Plant

Value Proposition

As a user

I want to update the details of existing plants,

so that they reflect the most accurate and relevant information.

Description

Image

Acceptance Criteria

Tasks

ahohnsen commented 1 day ago

Hi there!

I noticed a small detail in your tasks:

Change the submit button of the form so it accepts a prop in order to execute either a handleAdd function or a handleEdit function.

Perhaps this was just an oversight—actually, the submit function is attached to the form itself, not the submit button.

The submit function remains the same and just needs a slight adjustment:

First, the submit function should read the data from the form (as it does for the “create” action). Then, depending on whether the user is adding or editing, it should call either handleAdd or handleEdit with the form data.

Hope that helps!