Sha256: f1207df67045a482e879e42708d4c7be451e70aa8573085d2a0e9ddeba9cb3bd
Contents?: true
Size: 1.17 KB
Versions: 36
Compression:
Stored size: 1.17 KB
Contents
require_relative '../../controller' module Inferno module Web module Controllers module TestSessions module SessionData class ApplyPreset < Controller include Import[ test_sessions_repo: 'inferno.repositories.test_sessions', presets_repo: 'inferno.repositories.presets' ] def self.resource_class 'SessionData' end def handle(req, res) test_session_id = req.params[:id] test_session = test_sessions_repo.find(test_session_id) if test_session.nil? Application[:logger].error("Unknown test session #{test_session_id}") halt 404 end preset_id = req.params[:preset_id] preset = presets_repo.find(preset_id) if preset.nil? Application[:logger].error("Unknown preset #{preset_id}") halt 404 end test_sessions_repo.apply_preset(test_session, preset_id) res.status = 200 end end end end end end end
Version data entries
36 entries across 36 versions & 1 rubygems