Sha256: 0b5e357d49a989fa151028245f0478f5bfb731c7d73f0adcfa90d8158ce03401

Contents?: true

Size: 724 Bytes

Versions: 1

Compression:

Stored size: 724 Bytes

Contents

# frozen_string_literal: true

# @resource Tenants
#
# All resources in the system are relative to a particular tenant application.
PUNK.route("tenants") do
  require_session!

  # Retrieve the list of tenants visible to the authenticated user.
  # @path [GET] /tenants
  # @response [Array<Tenant>] 200 List of tenants
  # @method get
  # @example 200
  #   [{
  #     "id": "deadbeef-1234-5678-abcd-000000000000",
  #     "name": "Cool Tenant",
  #     "icon": "https://some.image/url"
  #   }]
  # @example 401
  #   {
  #     "message": "You are not authenticated.",
  #     "errors": ["Cannot find session"]
  #   }
  #
  # route: GET /tenants
  get do
    perform PUNK::ListTenantsAction, user: current_user
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
punk-0.4.1 lib/punk/routes/tenants.rb