Closed kotarella1110 closed 2 years ago
Thanks for your contribution @kotarella1110 and sorry about the delay! Asking @colevscode to review this
Thanks! Definitely we should expose the specific error codes. However, we're deprecating the ErrorPayload interface in favor of FormError and FieldError types. I've incorporated your suggestions into a PR on formspree-core here: https://github.com/formspree/formspree-core/pull/6/files. Let me know if this works and we'll merge after some testing.
I want to make the
errors
object type safe by defining the field error code as string literal union type. I got the field error code from the following documents. https://help.formspree.io/hc/en-us/articles/360055613373-The-Formspree-React-library#errorcodes