Class: Api::V1::Webhooks::Outgoing::EndpointsController

Inherits:
ApplicationController
  • Object
show all
Includes:
StrongParameters
Defined in:
app/controllers/api/v1/webhooks/outgoing/endpoints_controller.rb

Defined Under Namespace

Modules: StrongParameters

Instance Method Summary collapse

Methods included from StrongParameters

#endpoint_params

Instance Method Details

#createObject

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



15
16
17
18
19
20
21
# File 'app/controllers/api/v1/webhooks/outgoing/endpoints_controller.rb', line 15

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



33
34
35
# File 'app/controllers/api/v1/webhooks/outgoing/endpoints_controller.rb', line 33

def destroy
  @endpoint.destroy
end

#indexObject

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



7
8
# File 'app/controllers/api/v1/webhooks/outgoing/endpoints_controller.rb', line 7

def index
end

#showObject

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



11
12
# File 'app/controllers/api/v1/webhooks/outgoing/endpoints_controller.rb', line 11

def show
end

#updateObject

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



24
25
26
27
28
29
30
# File 'app/controllers/api/v1/webhooks/outgoing/endpoints_controller.rb', line 24

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