Add submission response to event details in tinyforms.js

This makes the submitted data more easily accessible
This commit is contained in:
2020-04-12 16:50:17 +02:00
parent 6e3e3ff8f6
commit dfa621d0bc
2 changed files with 3 additions and 3 deletions

View File

@@ -14,7 +14,7 @@ class SubmissionsController < ApplicationController
respond_to do |format|
if @submission.save
format.html { redirect_to(@form.thank_you_url) if @form.thank_you_url.present? }
format.json { render(json: { success: true, data: @submission.data }) }
format.json { render(json: { success: true, submission: @submission.data }) }
else
format.html { redirect_to(@form.thank_you_url) if @form.thank_you_url.present? }
format.json { render(json: { error: @submission.errors }, status: 422) }