Sha256: 9bbb5009bce2bfa9c93886fe122655a9d02345d260ddc568f24e09126472b7d0

Contents?: true

Size: 622 Bytes

Versions: 15

Compression:

Stored size: 622 Bytes

Contents

class CurrentBrandHandler < BaseHandler
    def mount
        @server.mount_proc('/brand/current') do |req, res|
            begin
                current_brand = BrandsManager.instance.current_brand
                if current_brand
                    res.status = 200
                    res.body = JSON.generate(current_brand)
                else
                    res.status = 204 # No Content
                end
                res.content_type = 'application/json'
            rescue StandardError => e
                handle_error(res, e, "Error fetching current brand")
            end
        end
    end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
solara-0.7.4 solara/lib/core/dashboard/handler/current_brand_handler.rb
solara-0.7.3 solara/lib/core/dashboard/handler/current_brand_handler.rb
solara-0.7.2 solara/lib/core/dashboard/handler/current_brand_handler.rb
solara-0.7.1 solara/lib/core/dashboard/handler/current_brand_handler.rb
solara-0.7.0 solara/lib/core/dashboard/handler/current_brand_handler.rb
solara-0.6.0 solara/lib/core/dashboard/handler/current_brand_handler.rb
solara-0.5.0 solara/lib/core/dashboard/handler/current_brand_handler.rb
solara-0.4.0 solara/lib/core/dashboard/handler/current_brand_handler.rb
solara-0.3.0 solara/lib/core/dashboard/handler/current_brand_handler.rb
solara-0.2.4 solara/lib/core/dashboard/handler/current_brand_handler.rb
solara-0.2.3 solara/lib/core/dashboard/handler/current_brand_handler.rb
solara-0.2.2 solara/lib/core/dashboard/handler/current_brand_handler.rb
solara-0.2.1 solara/lib/core/dashboard/handler/current_brand_handler.rb
solara-0.2.0 solara/lib/core/dashboard/handler/current_brand_handler.rb
solara-0.1.0 solara/lib/core/dashboard/handler/current_brand_handler.rb