Sha256: cf0d19df547df31da5037b130a96141b61bce5203e6a49322a7288b909efa9b9

Contents?: true

Size: 1.12 KB

Versions: 13

Compression:

Stored size: 1.12 KB

Contents

# frozen_string_literal: true

Rails.application.routes.draw do
  resources :webhooks, except: %i[index show new edit update] do
    collection do
      get 'auto_complete_search'
    end
  end
  match '/webhooks' => 'react#index', via: :get

  namespace :api, defaults: { format: 'json' } do
    scope '(:apiv)',
          module: :v2,
          defaults: { apiv: 'v2' },
          apiv: /v1|v2/,
          constraints: ApiConstraints.new(version: 2, default: true) do
      resources :webhooks, only: %i[index show create update destroy] do
        collection do
          get :events
        end
      end
      resources :webhook_templates, except: %i[new edit] do
        member do
          post :clone
          get :export
        end
        collection do
          post :import
        end
      end
    end
  end

  scope 'templates' do
    resources :webhook_templates, except: :show do
      member do
        get 'clone_template'
        get 'lock'
        get 'unlock'
        get 'export'
        post 'preview'
      end
      collection do
        post 'preview'
        get 'auto_complete_search'
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
foreman_webhooks-3.1.1 config/routes.rb
foreman_webhooks-3.1.0 config/routes.rb
foreman_webhooks-3.0.5 config/routes.rb
foreman_webhooks-2.0.3 config/routes.rb
foreman_webhooks-3.0.4 config/routes.rb
foreman_webhooks-2.0.2 config/routes.rb
foreman_webhooks-3.0.3 config/routes.rb
foreman_webhooks-3.0.2 config/routes.rb
foreman_webhooks-3.0.1 config/routes.rb
foreman_webhooks-2.0.1 config/routes.rb
foreman_webhooks-3.0.0 config/routes.rb
foreman_webhooks-2.0.0 config/routes.rb
foreman_webhooks-1.1.0 config/routes.rb