idurar / idurar-erp-crm

Open Source Headless ERP CRM E-Commerce Accounting Software | Node Js React
https://cloud.idurarapp.com/
Other
5.86k stars 1.73k forks source link

Fix issue #1101: "Please enter enabled" error was resolved #1119

Open Sujan14728 opened 1 month ago

Sujan14728 commented 1 month ago

Description

When the admin wants to add new product category, the enabled switch was initially undefined. Due to which the enabled switch had to be pressed twice to make it true otherwise it shows error while submitting the form. I resolved it by assigning initial values of enabled so that admin does not get validation error while submitting the form.

Related Issues

The form displayed an error message saying "Please enter enabled" when initially rendered. This was due to the 'enabled' field not having a initial value set, causing validation to fail on initial page load.

Steps to Test

  1. Go to productCategory
  2. Click on Add new and add the name ,description ,color
  3. Submit and the error "Please enter Enabled" is gone.(Previously you have to click the switch twice to make the enabled value to be true)

Testing