Closed JshGrn closed 2 years ago
Is there any reason why this feature isn't being considered?
We just tagged Contact Form 3.0.0-beta.1 with Craft 4 compatibility, which uses new asModelSuccess()
/ asModelFailure()
controller methods for contact-form/send
responses. asModefFailure()
will respond with a 400 status for Ajax requests.
Great news re V3 and Craft 4, however, I still don't think this should be closed for the V2. V3 introduces this functionality but not all my sites want to upgrade to 4 just yet, so I am still having to use this fork on those sites to provide status codes to Craft 3 sites.
I still think this should be merged into v2 for Craft 3. Its a very simple and basic change that will not effect people that don't want to use it, I can't see any reasons why not whilst Craft 4 is in beta.
Description
To be able to return a http error code when the validation fails, useful for dealing with the response on frontend. Retained status code 200 by default as to not break any existing functionality. Added setting as int so the user can decide if they want to throw 400 instead for example (I do so I can catch instead of searching a successful response for errors).