class Account::Webhooks::Outgoing::EndpointsController

def create

POST /account/teams/:team_id/webhooks/outgoing/endpoints.json
POST /account/teams/:team_id/webhooks/outgoing/endpoints
def create
  respond_to do |format|
    if @endpoint.save
      format.html { redirect_to [:account, @parent, :webhooks_outgoing_endpoints], notice: I18n.t("webhooks/outgoing/endpoints.notifications.created") }
      format.json { render :show, status: :created, location: [:account, @endpoint] }
    else
      format.html { render :new, status: :unprocessable_entity }
      format.json { render json: @endpoint.errors, status: :unprocessable_entity }
    end
  end
end

def destroy

DELETE /account/webhooks/outgoing/endpoints/:id.json
DELETE /account/webhooks/outgoing/endpoints/:id
def destroy
  @endpoint.destroy
  respond_to do |format|
    format.html { redirect_to [:account, @parent, :webhooks_outgoing_endpoints], notice: I18n.t("webhooks/outgoing/endpoints.notifications.destroyed") }
    format.json { head :no_content }
  end
end

def edit

GET /account/webhooks/outgoing/endpoints/:id/edit
def edit
end

def endpoint_params

Never trust parameters from the scary internet, only allow the white list through.
def endpoint_params
  strong_params = params.require(:webhooks_outgoing_endpoint).permit(
    :name,
    :url,
    :scaffolding_absolutely_abstract_creative_concept_id,
    # 🚅 super scaffolding will insert new fields above this line.
    event_type_ids: [],
    # 🚅 super scaffolding will insert new arrays above this line.
  )
  assign_select_options(strong_params, :event_type_ids)
  # 🚅 super scaffolding will insert processing for new fields above this line.
  strong_params
end

def index

GET /account/teams/:team_id/webhooks/outgoing/endpoints.json
GET /account/teams/:team_id/webhooks/outgoing/endpoints
def index
  # if you only want these objects shown on their parent's show page, uncomment this:
  # redirect_to [:account, @team]
end

def new

GET /account/teams/:team_id/webhooks/outgoing/endpoints/new
def new
end

def show

GET /account/webhooks/outgoing/endpoints/:id.json
GET /account/webhooks/outgoing/endpoints/:id
def show
end

def update

PATCH/PUT /account/webhooks/outgoing/endpoints/:id.json
PATCH/PUT /account/webhooks/outgoing/endpoints/:id
def update
  respond_to do |format|
    if @endpoint.update(endpoint_params)
      format.html { redirect_to [:account, @endpoint], notice: I18n.t("webhooks/outgoing/endpoints.notifications.updated") }
      format.json { render :show, status: :ok, location: [:account, @endpoint] }
    else
      format.html { render :edit, status: :unprocessable_entity }
      format.json { render json: @endpoint.errors, status: :unprocessable_entity }
    end
  end
end