Module: Api::V1::Webhooks::Outgoing::Endpoints::ControllerBase

Extended by:
ActiveSupport::Concern
Included in:
Api::V1::Webhooks::Outgoing::EndpointsController
Defined in:
app/controllers/concerns/api/v1/webhooks/outgoing/endpoints/controller_base.rb

Defined Under Namespace

Modules: StrongParameters

Instance Method Summary collapse

Instance Method Details

#createObject

POST /api/v1/teams/:team_id/webhooks/outgoing/endpoints



45
46
47
48
49
50
51
# File 'app/controllers/concerns/api/v1/webhooks/outgoing/endpoints/controller_base.rb', line 45

def create
  if @endpoint.save
    render :show, status: :created, location: [:api, :v1, @endpoint]
  else
    render json: @endpoint.errors, status: :unprocessable_entity
  end
end

#destroyObject

DELETE /api/v1/webhooks/outgoing/endpoints/:id



63
64
65
# File 'app/controllers/concerns/api/v1/webhooks/outgoing/endpoints/controller_base.rb', line 63

def destroy
  @endpoint.destroy
end

#indexObject

GET /api/v1/teams/:team_id/webhooks/outgoing/endpoints



37
38
# File 'app/controllers/concerns/api/v1/webhooks/outgoing/endpoints/controller_base.rb', line 37

def index
end

#showObject

GET /api/v1/webhooks/outgoing/endpoints/:id



41
42
# File 'app/controllers/concerns/api/v1/webhooks/outgoing/endpoints/controller_base.rb', line 41

def show
end

#updateObject

PATCH/PUT /api/v1/webhooks/outgoing/endpoints/:id



54
55
56
57
58
59
60
# File 'app/controllers/concerns/api/v1/webhooks/outgoing/endpoints/controller_base.rb', line 54

def update
  if @endpoint.update(endpoint_params)
    render :show
  else
    render json: @endpoint.errors, status: :unprocessable_entity
  end
end