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



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

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



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

def destroy
  @endpoint.destroy
end

#indexObject

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



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

def index
end

#showObject

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



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

def show
end

#updateObject

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



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

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