Sha256: c294c550a24228c319eac3c8dd06669dcc4fd7a60102b16df4e5f98ceef6ad19
Contents?: true
Size: 934 Bytes
Versions: 22
Compression:
Stored size: 934 Bytes
Contents
module Api class HooksController < BaseController require_permission :read, :hook, only: %i(index show) require_permission :write, :hook, only: %i(create update destroy) def index render_resources hooks end def show render json: hook end params do requires :url, String requires :events, Array[String] accepts :content_type, String end def create render_resource hooks.create(params) end params do accepts :url, String accepts :events, Array[String] accepts :content_type, String end def update hook.update(params) render_resource hook end def destroy render_resource hook.destroy end private def hook hooks.find(params[:id]) end def hooks Hook.where(stack_id: stack_id) end def stack_id stack.id if params[:stack_id].present? end end end
Version data entries
22 entries across 22 versions & 1 rubygems