We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
_show,json.jbuilder
1 parent 62c4498 commit 8f3beafCopy full SHA for 8f3beaf
app/views/api/v2/plans/_show.json.jbuilder
@@ -57,6 +57,24 @@ unless @minimal
57
58
outputs = plan.research_outputs.any? ? plan.research_outputs : [plan]
59
60
+ if @question_and_answer
61
+ json.questions_and_answers do
62
+ outputs.each do |output|
63
+ presenter = Api::V2::ResearchOutputPresenter.new(output: output)
64
+ q_and_a = presenter.send(:fetch_all_q_and_a, plan: plan)
65
+ next if q_and_a.blank?
66
+
67
+ json.set! output.id.to_s do
68
+ json.array! q_and_a do |item|
69
+ json.title item[:title]
70
+ json.question item[:question]
71
+ json.answer item[:answer]
72
+ end
73
74
75
76
77
78
json.dataset outputs do |output|
79
json.partial! "api/v2/datasets/show", output: output
80
end
0 commit comments