Sha256: c2616c586f1800388808b9e65eb71ac5ab328b7a88ed55d7d4d4649ea076705d

Contents?: true

Size: 1.57 KB

Versions: 108

Compression:

Stored size: 1.57 KB

Contents

class Api::V1::Webhooks::Outgoing::EndpointsController < Api::V1::ApplicationController
  account_load_and_authorize_resource :endpoint,
    through: BulletTrain::OutgoingWebhooks.parent_association,
    through_association: :webhooks_outgoing_endpoints

  # GET /api/v1/teams/:team_id/webhooks/outgoing/endpoints
  def index
  end

  # GET /api/v1/webhooks/outgoing/endpoints/:id
  def show
  end

  # POST /api/v1/teams/:team_id/webhooks/outgoing/endpoints
  def create
    if @endpoint.save
      render :show, status: :created, location: [:api, :v1, @endpoint]
    else
      render json: @endpoint.errors, status: :unprocessable_entity
    end
  end

  # PATCH/PUT /api/v1/webhooks/outgoing/endpoints/:id
  def update
    if @endpoint.update(endpoint_params)
      render :show
    else
      render json: @endpoint.errors, status: :unprocessable_entity
    end
  end

  # DELETE /api/v1/webhooks/outgoing/endpoints/:id
  def destroy
    @endpoint.destroy
  end

  private

  module StrongParameters
    # Only allow a list of trusted parameters through.
    def endpoint_params
      strong_params = params.require(:webhooks_outgoing_endpoint).permit(
        *permitted_fields,
        :url,
        :name,
        :api_version,
        :scaffolding_absolutely_abstract_creative_concept_id,
        # 🚅 super scaffolding will insert new fields above this line.
        *permitted_arrays,
        event_type_ids: [],
        # 🚅 super scaffolding will insert new arrays above this line.
      )

      process_params(strong_params)

      strong_params
    end
  end

  include StrongParameters
end

Version data entries

108 entries across 108 versions & 1 rubygems

Version Path
bullet_train-outgoing_webhooks-1.10.0 app/controllers/api/v1/webhooks/outgoing/endpoints_controller.rb
bullet_train-outgoing_webhooks-1.9.0 app/controllers/api/v1/webhooks/outgoing/endpoints_controller.rb
bullet_train-outgoing_webhooks-1.8.5 app/controllers/api/v1/webhooks/outgoing/endpoints_controller.rb
bullet_train-outgoing_webhooks-1.8.4 app/controllers/api/v1/webhooks/outgoing/endpoints_controller.rb
bullet_train-outgoing_webhooks-1.8.3 app/controllers/api/v1/webhooks/outgoing/endpoints_controller.rb
bullet_train-outgoing_webhooks-1.8.2 app/controllers/api/v1/webhooks/outgoing/endpoints_controller.rb
bullet_train-outgoing_webhooks-1.8.1 app/controllers/api/v1/webhooks/outgoing/endpoints_controller.rb
bullet_train-outgoing_webhooks-1.8.0 app/controllers/api/v1/webhooks/outgoing/endpoints_controller.rb
bullet_train-outgoing_webhooks-1.7.23 app/controllers/api/v1/webhooks/outgoing/endpoints_controller.rb
bullet_train-outgoing_webhooks-1.7.22 app/controllers/api/v1/webhooks/outgoing/endpoints_controller.rb
bullet_train-outgoing_webhooks-1.7.21 app/controllers/api/v1/webhooks/outgoing/endpoints_controller.rb
bullet_train-outgoing_webhooks-1.7.20 app/controllers/api/v1/webhooks/outgoing/endpoints_controller.rb
bullet_train-outgoing_webhooks-1.7.19 app/controllers/api/v1/webhooks/outgoing/endpoints_controller.rb
bullet_train-outgoing_webhooks-1.7.18 app/controllers/api/v1/webhooks/outgoing/endpoints_controller.rb
bullet_train-outgoing_webhooks-1.7.17 app/controllers/api/v1/webhooks/outgoing/endpoints_controller.rb
bullet_train-outgoing_webhooks-1.7.16 app/controllers/api/v1/webhooks/outgoing/endpoints_controller.rb
bullet_train-outgoing_webhooks-1.7.15 app/controllers/api/v1/webhooks/outgoing/endpoints_controller.rb
bullet_train-outgoing_webhooks-1.7.14 app/controllers/api/v1/webhooks/outgoing/endpoints_controller.rb
bullet_train-outgoing_webhooks-1.7.13 app/controllers/api/v1/webhooks/outgoing/endpoints_controller.rb
bullet_train-outgoing_webhooks-1.7.12 app/controllers/api/v1/webhooks/outgoing/endpoints_controller.rb