Skip to content

Commit b3d9c2d

Browse files
committed
Update plans_controller to include question and answer flag
- This optional parameter is added to the plans endpoints in the V2 API
1 parent 10380fa commit b3d9c2d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

app/controllers/api/v2/plans_controller.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ def show
1717
raise Pundit::NotAuthorizedError unless plans_policy.show?
1818

1919
@items = [@plan]
20+
@question_and_answer = ActiveModel::Type::Boolean.new.cast(params[:question_and_answer])
21+
2022
render '/api/v2/plans/index', status: :ok
2123
end
2224

@@ -26,6 +28,8 @@ def index
2628

2729
@plans = PlansPolicy::Scope.new(@resource_owner).resolve
2830
@items = paginate_response(results: @plans)
31+
@question_and_answer = ActiveModel::Type::Boolean.new.cast(params[:question_and_answer])
32+
2933
render '/api/v2/plans/index', status: :ok
3034
end
3135
end

0 commit comments

Comments
 (0)