return 422 when submit archived submission
This commit is contained in:
@@ -42,6 +42,12 @@ class SubmitFormController < ApplicationController
|
|||||||
return render json: { error: 'Form has been completed already.' }, status: :unprocessable_entity
|
return render json: { error: 'Form has been completed already.' }, status: :unprocessable_entity
|
||||||
end
|
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)
|
Submitters::SubmitValues.call(submitter, params, request)
|
||||||
|
|
||||||
head :ok
|
head :ok
|
||||||
|
|||||||
@@ -749,7 +749,7 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
alert(error)
|
console.error(error)
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
this.isSubmitting = false
|
this.isSubmitting = false
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user