add base API error messages

This commit is contained in:
Alex Turchyn
2024-01-19 03:03:45 +02:00
committed by Pete Matsyburka
parent 0a00fe6ab8
commit f9ccca1376
4 changed files with 192 additions and 0 deletions
@@ -63,6 +63,8 @@ module Api
end
def create
Params::SubmissionCreateValidator.call(params, dry_run: true)
return render json: { error: 'Template not found' }, status: :unprocessable_entity if @template.nil?
if @template.fields.blank?