Sha256: 7a9dd554bb7cde465ea4b0702e49151f0f5a374a5001be39e43b80ad34952416

Contents?: true

Size: 1.03 KB

Versions: 4

Compression:

Stored size: 1.03 KB

Contents

# frozen_string_literal: true

Rails.application.routes.draw do
  resources :webhooks, except: %i[index show] 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]
      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

4 entries across 4 versions & 1 rubygems

Version Path
foreman_webhooks-1.0.0 config/routes.rb
foreman_webhooks-0.0.3 config/routes.rb
foreman_webhooks-0.0.2 config/routes.rb
foreman_webhooks-0.0.1 config/routes.rb