Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions app/api/demo_scenario_api.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# frozen_string_literal: true

require 'grape'
require Rails.root.join('lib/demo_data/all_features_scenario')

class DemoScenarioApi < Grape::API
helpers AuthenticationHelpers

before do
header 'Cache-Control', 'private, no-store'
authenticated?
end

desc 'Get the guarded local mobile-feedback demo scenario contract',
tags: ['demo'],
summary: 'Get guarded local demo scenario'
get '/demo/scenario' do
DemoData::AllFeaturesScenario.contract_for(user: current_user)
rescue DemoData::AllFeaturesScenario::SafetyError
error!({ error: 'Not found.' }, 404)
end
end
Loading