mirror of
https://github.com/docusealco/docuseal
synced 2026-11-05 22:52:32 -05:00
improve required field handling
This commit is contained in:
1 parent
f1a2b71b59
commit
28e3d65e63
3 files changed
+55
-15
No files matched your search
@@ -72,6 +72,10 @@ class SubmitFormController < ApplicationController
|
||||
Submitters::SubmitValues.call(submitter, params, request)
|
||||
|
||||
head :ok
|
||||
rescue Submitters::SubmitValues::RequiredFieldError => e
|
||||
Rollbar.warning("Required field #{submitter.id}: #{e.message}") if defined?(Rollbar)
|
||||
|
||||
render json: { field_uuid: e.message }, status: :unprocessable_entity
|
||||
rescue Submitters::SubmitValues::ValidationError => e
|
||||
render json: { error: e.message }, status: :unprocessable_entity
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user