return 422 when submit archived submission

This commit is contained in:
Pete Matsyburka
2023-12-19 15:45:30 +02:00
parent e558f4d9fb
commit 203f4633f7
2 changed files with 7 additions and 1 deletions
@@ -42,6 +42,12 @@ class SubmitFormController < ApplicationController
return render json: { error: 'Form has been completed already.' }, status: :unprocessable_entity
end
if submitter.template.deleted_at? || submitter.submission.deleted_at?
Rollbar.info("Archived template: #{submitter.template.id}") if defined?(Rollbar)
return render json: { error: 'Form has been archived.' }, status: :unprocessable_entity
end
Submitters::SubmitValues.call(submitter, params, request)
head :ok
+1 -1
View File
@@ -749,7 +749,7 @@ export default {
}
}
}).catch(error => {
alert(error)
console.error(error)
}).finally(() => {
this.isSubmitting = false
})