Bug#209 - Issue Resolved: Form Retains Old Data on "Create New Project" #93

Merged
vikas.nale merged 2 commits from pramod_Bug-#209 into Issue_May_2W 2025-05-10 10:42:38 +00:00
Collaborator

Issue
After creating a new project, clicking "Create New Project" again would display the data from the previously created project.
The form was not being reset after submission, so its state persisted.

Fixed
Added a reset() call after form submission to clear the form state:

const onSubmitForm = (updatedProject) => {
  setLoading(true);
  handleSubmitForm(updatedProject, setLoading);
  reset(); // Clears the form
};

const onSubmitForm = (updatedProject) => {
  setLoading(true);
  handleSubmitForm(updatedProject, setLoading,reset);

};
**Issue** After creating a new project, clicking "Create New Project" again would display the data from the previously created project. The form was not being reset after submission, so its state persisted. **Fixed** Added a reset() call after form submission to clear the form state: ``` const onSubmitForm = (updatedProject) => { setLoading(true); handleSubmitForm(updatedProject, setLoading); reset(); // Clears the form }; ``` ``` const onSubmitForm = (updatedProject) => { setLoading(true); handleSubmitForm(updatedProject, setLoading,reset); }; ```
pramod.mahajan added 1 commit 2025-05-10 08:12:36 +00:00
pramod.mahajan added 1 commit 2025-05-10 09:48:05 +00:00
Author
Collaborator

Same thing was happening in report task, so their added,
reset, setLoading(false) after api executation is completed.

Same thing was happening in report task, so their added, reset, setLoading(false) after api executation is completed.
vikas.nale merged commit 5d5e33f308 into Issue_May_2W 2025-05-10 10:42:38 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: admin/marco.pms.web#93
No description provided.