hexlet-correction
hexlet-correction copied to clipboard
Feature request: Add validation on the widget side
Problem description
At the moment, the user will not be able to understand in any way that he has not fulfilled some validation rules set up on the backend. For example, enter a name longer than 50 characters, click send -> the widget just closes and everything looks like the report has been sent, but in fact we get a Bad request.
Proposed solution
It would be good to validate the data in the widget code before sending the report and give hints that some data is not suitable and why
Or, in order not to duplicate the validation rules (which may change), we can receive an error from the backend, where errors will be passed in the body, and process them in the widget